YES or NO to semicolons in object events

I searched, but could not find the answer to this question. If in the HTML DOM EVENTS, for example, onChange, onSelect, onKeyUp, onFocus, onClick, etc., specify a semicolon, for example, two lines below.

onChange="this.form.submit();" OR onChange="this.form.submit()"

“YES” or “NO” or “Does not matter”

I think it does not matter, but then again, what is the best, the most correct?

THANK YOU ALL!

+5
source share
4 answers

It does not matter.

The value of the attribute of the event handler is considered as a series of statements that are wrapped in a function signature similar to

 function (event) {
   with (event.target.ownerDocument) {
     with (event.target) {
       // attribute body goes here
     }
   }
 }

SourceElement JavaScript .

+9

, , , .

+1

, . , , . - -, HTML, CSS Javascript, . Www.w3school.com . Javascript: http://www.w3schools.com/js/default.asp , , : http://www.w3schools.com/js/js_popup.asp onclick, .

+1

; JavaScript, , . ( .)

+1

All Articles