Select images having a specific onmouseover call using jQuery
I have a php code that generates a piece of html code like this.
<img src="images/1.jpg" onmouseover="funct_update(1, 10, 21)" onclick="funct_click(...)" />
<img src="images/2.jpg" onmouseover="funct_update(5, 2, 9)" onclick="funct_click(...)" />
<img src="image开发者_开发知识库s/3.jpg" onmouseover="funct_update(8, 12, 100)" onclick="funct_click(...)" />
Now since I don't want to touch the PHP code, I wonder if it is possible to select, using jQuery, all images having as attribute onmouseover="funct_update(.*)"
, and bind +1 function for onmouseover event.
Take a look a James Padolsey regex filter which can be used as follows:
$("img:regex(onmouseover, funct_update.*)").mouseover(function(){
// Your New Function Here
});
Hope this helps!
精彩评论