1

I am having problem with what must be the simplest thing . A table row with a close icon in it with the idea that I can click on the icon and delete the row.

<tr><td>data here</td><td><span class="clDeleteX ui-icon ui-icon-closethick"></td></tr>

with a

$("#clDeleteX").click(function(ev){
    alert('icon clicked');
})

Can anyone dislodge the fog in my brain?

Oh yes I s'pose I should state the problem - nothing happens..

2 Answers 2

6

In selectors, # prefix is for IDs, you have to use . for classes.

$(".clDeleteX").click(function(ev){
    alert('icon clicked');
})
Sign up to request clarification or add additional context in comments.

Comments

0

change you code

$("#clDeleteX").click(function(ev){
    alert('icon clicked');
})

to

$(".clDeleteX").click(function(ev){
    alert('icon clicked');
})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.