Page 1 of 1

push element in array

Posted: Thu Dec 09, 2010 9:41 pm
by esandra
I want to have an array wherein I could push values every time the function is triggered

when this button is clicked

Code: Select all

<img src="images/del.png" width="15" height="15" onclick="hide(<?php echo $y;?>)">
this will be called

Code: Select all

function hide(y){	
		y=y-1
		var line="line"+y
		document.getElementById(line).style.display="none"

//the array is supposed to be in here to record the values of all the $y that ever called this function
	}

Re: push element in array

Posted: Tue Jan 11, 2011 7:00 am
by kalpesh.mahida
define variable "line" outside of your function