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

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -