So I captured an image ID in a jquery variable such as:
$ ("# Tag IMG"). Click (function (e) {var element = $ (this) .attr ("id");
I then var element
if ($ (element * $ ('# Tag # view_name)' ') .text ("Tag with Square");} elseif ($ (element * =' circle ') {$ ( '# Tag #view_name'). Text ("Tag with a circle");}
thanks:
Edit: Oh, and the text I was looking for It's I. I have two strings in single quotes ('square' and 'circle').
Edit: All the answers given below are given below as they should be done ... but they are not This is The other is the code, so people can see if I am missing something:
Edit 3: OK ... It seems that some other jQuery was hijacking that div, all the answers are right I believe Is that I can correct them all :) $ ("" "" ") Is similar to
selector (example by your comment) name = $ (this) .attr ("name"); if (name.indexOf ('square')> gt 0 = {$ ('# tag #view_name'). Text (" Tag with a square ");}
Comments
Post a Comment