Jump to content

dont know how to select a dynamically generated 'type' attr's value using jquery.


Recommended Posts

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:
var hide_status=$(".statusboxes").attr('type');
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 ;


Link to comment
Share on other sites

the code is now working after changing to this:

var hide_status=$(".statusboxes").attr('div', 'type');
Edited by shan
Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.