Count values with after close window javascript -


i have images:

<img src=""> <img src=""> <img src=""> 

i need add same data don't know how add name="1" or name="0" or similar. , if close window show me alert return same page , information counted if name ==0 show alert.

try this,

document.getelementsbytagname('img')[0].name="0"; document.getelementsbytagname('img')[1].name="2"; . . 

or

with jquery

$('img').each(function(){     this.name=this.indexof(); } $(window).on('unload',function(){     alert("watevr want"); } 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -