shan Posted October 19, 2015 Share Posted October 19, 2015 hi guys im trying to hide a specific class selector in jquery. where the id and the type attributes are generated dynamically. but dont know how to select and hide it so, as to do a ajax call. can anyone help. here is the code for the jquery: $(".hidden_text_area").click(function(){ $(".hidden_edit_4_session").show(); var hide_status=$(".statusboxes").attr('type'); $(hide_status).find(".statusboxes").hide(); }); and here is the code where the type attribute is which i want to select and hide if the user clicks edit button. $status_list='<fieldset><div class="jumbotron"><div id="'.$updateid.'" type="'.$updateid.'" class="statusboxes">' . '<h3 style="text-align:left; color:black;" class="pull-left">'.$title.'</h3>' . '<span class="pull-right">' . '<div class="dropdown">' . '<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" >' . '<span class="glyphicon glyphicon-edit"></span></button>' . '<ul class="dropdown-menu">' . '<li><a href="#" class="hidden_text_area glyphicon glyphicon-pencil" title="Edit this status" >Edit</a></li>'.$statusdeletebutton.'</ul></div></span><br><hr><span class="pull-left"style="font-size:14px; text-align:left; color:black;"><legend>' . $data.'</legend></span><br><b style="text-align:right; color:black;"><small>Posted by:- <a href="search_results.php?u='.$author.'">'.$author. '</a> '.$post_date.'</small></b>' . '<br>'.$status_replies . '</div></div>'.$statusui_edit ; Quote Link to comment https://forums.phpfreaks.com/topic/298692-dont-know-how-to-select-a-dynamically-generated-type-attrs-value-using-jquery/ Share on other sites More sharing options...
scootstah Posted October 19, 2015 Share Posted October 19, 2015 Attribute selectors Quote Link to comment https://forums.phpfreaks.com/topic/298692-dont-know-how-to-select-a-dynamically-generated-type-attrs-value-using-jquery/#findComment-1523665 Share on other sites More sharing options...
shan Posted October 19, 2015 Author Share Posted October 19, 2015 (edited) @scootstah thanks for the resource, Edited October 19, 2015 by shan Quote Link to comment https://forums.phpfreaks.com/topic/298692-dont-know-how-to-select-a-dynamically-generated-type-attrs-value-using-jquery/#findComment-1523673 Share on other sites More sharing options...
shan Posted October 19, 2015 Author Share Posted October 19, 2015 (edited) the code is now working after changing to this: $(".hidden_text_area").click(function(){ $(".hidden_edit_4_session").show(); var hide_status=$(".statusboxes").attr('div', 'type'); $(hide_status).hide(); }); Edited October 19, 2015 by shan Quote Link to comment https://forums.phpfreaks.com/topic/298692-dont-know-how-to-select-a-dynamically-generated-type-attrs-value-using-jquery/#findComment-1523680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.