i have situation have td:
<td id="divintimestamp-5-2" style="background: none repeat scroll 0% 0% red;"> 12:55 pm <span><img style="vertical-align: middle;" src="/content/themes/base/images/info.png"><span class="tooltip">clocked in from: <br>host: id14011.o2.local<br>ip address: 10.0.2.49</span></span> <a title="edit clockin time" class="inline updatelink timesheetidentity" href="">[ Δ ]</a> </td> how can value 12:55 pm td?
var text = $.trim($('#divintimestamp-5-2')[0].firstchild.nodevalue); [0]gets reference dom element#divintimestamp-5-2. shorthand.get(0)..firstchildgets first child text node..nodevaluecontains text node's content.$.trimcross-browser white space trimming.
Comments
Post a Comment