Passing a string in onclick function's attribute of element dynamically created element

后端 未结 8 2178
迷失自我
迷失自我 2021-02-09 00:27

I am trying to pass a string in the onClick event handler function\'s arguments of the dynamically created anchor element, see the fiddle http://jsfiddle.net/shmdhussain/bXYe4/.

8条回答
  •  误落风尘
    2021-02-09 01:03

    perhaps instead, use a data attribute on the element to hold the string. then in the function retrieve the data.

提交回复
热议问题