php - How to pass parameters permanently javascript function -
how make function work whenever element created clicked uses parameters function in actual click event.
function createlink(text, parentelement) { var = document.createelement('p'); var linktext = document.createtextnode(text); a.appendchild(linktext); temp1 = text.replace("/","-"); temp2 = res1.replace("/","-"); a.onclick = gospecificprev(temp2,linktext); parentelement.appendchild(a); var br = document.createelement('br'); parentelement.appendchild(br); }
the parameters in questions in line:
a.onclick = gospecificprev(temp2,linktext);
being temp2 , linktext.
Comments
Post a Comment