How do I make a HTML button work in an AJAX function?

Hameem

New member
y=y+1;
added="";
for(i in testArray)
{
added ="<b>" + added + testArray + "</b>"+"<button type='button' onclick='delTest()' value='Delete'>Delete</button>"+"<br/>" ;
}
document.getElementById('showTestDiv').innerHTML = added;

This is the function I'm talking about. Now, I'd like to pass the value of the AJAX variable 'y' via that delTest() function. Something like this "onclick=delTest(y)" but it doesn't work. How do I do that? Anyone with an appropriate syntax?
Thanks.
 
Back
Top