I want to create link that send to function:
tdLink2.innerText="Delete";
tdLink2.href="javascript:deleteDepartment(id)"
but the "id" parameters was not sent.
Who I can do this with the parameters? (Javascript)
Thank you.
>Solution :
If id is already defined variable then u can do like this
tdLink2.href=`javascript:deleteDepartment(${id})`
U can do this if id is of type string
otherwise u can go for this
function f(){
deleteDepartment(id)
}
tdLink2.href='javascript:f()'