tags:

views:

134

answers:

2

I am having trouble accessing a div element within a table.

// All within document ready ...

$('.ChangeStatus').click(function()
{
    $('#status_display:100').html('Updated');   

});

Here is the HTML

<td>
     <div class="status_display" id="status_display:100">
          open<br/>
          <a href="#" class="ChangeStatus" id="close:100">Close lead</a>
     </div>
</td>

WHen I click the anchor it says the html of the div is null before and after I try to set the html.

Thanks in advance!

+1  A: 

jQuery has problems with IDs that contain colons:

Related question

Plynx
Thank you sir works perfectly. Did not know that jQuery had issues with colons as ids.
dnaluz
+6  A: 

The : character is a special character in jquery selectors which needs to be escaped.

Try this $('#status_display\\:100').html('Updated');

PetersenDidIt
Awesome, I didn't know you could escape them like that.
Plynx