push element in array

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
esandra
Forum Newbie
Posts: 24
Joined: Sun Aug 30, 2009 11:11 pm

push element in array

Post 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
	}
kalpesh.mahida
Forum Commoner
Posts: 36
Joined: Wed Oct 06, 2010 7:09 am

Re: push element in array

Post by kalpesh.mahida »

define variable "line" outside of your function
Post Reply