using jquery to change html table attributes

maqskywalker used Ask the Experts™
Hi experts,

I'm using jQuery 1.10.1
I have a html table that looks like this:

my fiddle when i run it
This is my fiddle:

How do i use jQuery to remove this  <a href="" target="_blank"></a>  tag from the LastName column values for all the Employees with the title 'Sales Representative'?

I was thinking of using the jquery remove attribute but not sure if that is the best way.
Anyone know how?

So my page should look like this:

my desires result
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer
Try this:
$('#TableEmployees tr:has(td:eq(3):contains("Sales Representative"))').each(function(){
    var td1 = $(this).children('td:eq(1)');
    td1.html(td1.html().replace(/<a href="http:\/\/" target="_blank">([^<]*)<\/a>/i, '$1'));

Open in new window

updated fiddle:


Great! thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial