+ 6

Jquiry identifying a button - Question

<button onClick="function" >Click me</button> <button onClick="function" >Click me</button> <button onClick="function" >Click me</button> <button onClick="function" >Click me</button> <button onClick="function" >Click me</button> I want a Jquiry script that can indentify which button is pressed and change the text without a id.

23rd Apr 2018, 5:26 PM
Arne Van Kerckvoorde
Arne Van Kerckvoorde - avatar
1 ответ
0
just use $("button").on("click", function(){ this.html("new text"); })
23rd Apr 2018, 5:52 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar