JS onclick in this usage

When using onclick bind event in the dom element, you can use this to point to the element object.

Printout is:

 

 It is possible to get the child element of this subject by the

// Get element by a label in the audio objects 
function
Play (. 1 , element) { the let audio = element.getElementByTagName ( 'audio') [0 ]; audio.play (); }

Guess you like

Origin www.cnblogs.com/liao123/p/11608414.html