Tuesday, December 22, 2009

[jQuery] jQuery Selector Help

Long time listner, first time caller ...

I am struggling with a selctor and am hopeful someone can help me see
the forest through the trees. I am using a WordPress plugin which
generates the following HTML:

<td class="day-with-date">
<span class="weekend">26</span>
<span class="event"><br />
*
<span class="calnk" nowrap="nowrap">
<a href="#" style="">Christmas Break
<span style="">
<div class="event-title">Christmas Break</div>
<div class="event-title-break"></div></span></a></span><br />
*
<span class="calnk" nowrap="nowrap">
<a href="http://localhost/?p=104" style="">
Futsal Training
<span style="">
<div class="event-title">Futsal Training</div>
<div class="event-title-break"></div><strong>Time:</strong> 1:30
pm<br />
<div class="event-content-break"></div>
Futsal Training at NetSports
</span>
</a>
</span>
</span>
</td>

I want to strip the asterisk characters ("*") from the HTML. I have
been able to tweak a few things but I am struggling with a selctor
which would allow me to eliminate the asterisk. Any help or
suggestions would be approeciated. I was trying to do this but
innerHTML returns undefined and I am not sure why.

jQuery('span.even > br').each(function() {
html = this.innerHTML ;
// Some manipulation goes here
jQuery(this).html(html) ;
}

I am by no means a jQuery guru so I am sure I am missing something
obvious.

Thanks,

Mike

No comments: