3
<table class="subTable">
  <tr><td>09:00</td><td>-</td><td>18:00</td></tr>
  <tr><td colspan="3"><!-- 呜呜呜旺旺旺旺王旺旺旺旺wwwwww -->呜呜呜旺...</td></tr>
  <tr class="nomoreEvents" style="display:none;"><td colspan="3"><span class="hideId">456</span>&nbsp;</td></tr>
</table>

how to get the content inside the comments ( <!-- --> ), ie: i want to get 呜呜呜旺旺旺旺王旺旺旺旺wwwwww

Greg Pettit
  • 10,749
  • 5
  • 53
  • 72
Phoenix
  • 1,055
  • 1
  • 12
  • 27
  • See this post, may be its useful to you; http://stackoverflow.com/questions/1623734/selecting-html-comments-with-jquery – Mudassir Nov 28 '11 at 03:43

1 Answers1

2

[edited:] Apparently you can retrieve comments, and Mudassir's link should get you there if you want to go that way, though. Glad I supplied an alternative method for you, though, if it does what you want!

If you're looking for another way to "store" extra information, there are many other ways of doing it. You could use data-* attributes, or even recycle an existing attribute such as title or ID. Then you would have:

<td colspan="3" title="呜呜呜旺旺旺旺王旺旺旺旺wwwwww">呜呜呜旺...</td>

..and the way to retrieve it with jQuery would be something like:

$('td:eq(3)').attr('title');

(The td:eq(3) is probably not the most flexible selector you could be using; I just grabbed one that worked. If we know the basis for selection, we can provide something more flexible)

Greg Pettit
  • 10,749
  • 5
  • 53
  • 72
  • put in title that's good idea and what i want, thank you! due to my poor jquery skill , i wish to make more flexible code – Phoenix Nov 28 '11 at 03:44
  • 1
    I don't usually mention it, but since you may not know the Stack Overflow system: if this is the answer you ended up using, there's an "accept" button you can check off. It helps you as well; if you decide to stick around Stack Overflow, people are more likely to help someone with a good rate of accepting answers. ;-) – Greg Pettit Nov 28 '11 at 19:42