Home > Web Front-end > JS Tutorial > open Dynamically modify img's onclick event sample code_javascript skills

open Dynamically modify img's onclick event sample code_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:15:35
Original
1424 people have browsed it
复制代码 代码如下:

var imgsrc = document.getElementById("imgsrc").getElementsByTagName('img');
imgsrc[0].style.cursor="hand";
imgsrc[0].onclick = new Function( "openArticle('/RssCommServlet?catalogid=29')");
imgsrc[1].style.cursor="hand";
imgsrc[1].onclick = new Function( "openArticle('/RssCommServlet?catalogid=30')");
imgsrc[2].style.cursor="hand";
imgsrc[2].onclick = new Function( "openArticle('/RssCommServlet?catalogid=31')");


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Can't open
From 1970-01-01 08:00:00
0
0
0
Where can I open UNREGISTERED?
From 1970-01-01 08:00:00
0
0
0
Open cad file in php?
From 1970-01-01 08:00:00
0
0
0
How to open the editor
From 1970-01-01 08:00:00
0
0
0
How to open the editor
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template