简体   繁体   中英

manipulating css on jquery ajax loaded content

I have an html file with a hidden button. After i do a jquery $.ajax call, i want to show the button in the content. So i tried

//...
dataType: html,
success: function(data) {
    $('.somediv').append(data);
    $('input').show(); //the button in the data content that i want to display
}
//...

Is there any other way to solve this?

If i use a tag in the top of the loaded content, i can solve it that way. But it feels like a bad solution.

Edit: html + js from "data": http://jsfiddle.net/JvyBw/

This should work fine:

$('.somediv')
    .append(data)
    .find('input')
         .show();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM