html
is a jQuery function. innerHTML
is a non-standard (but well supported) property.
If you look at the code you will see that .html()
parses scripts, and eval
s them.
To find it in the source:
Find the html
declaration: https://github.com/jquery/jquery/blob/1.11.0/src/manipulation.js#L564-604
See it does .append
. append
in turn calls DomManip[ulate]
which will parse and eval
scripts.
Relevant bit in DomManip[ulate]
: https://github.com/jquery/jquery/blob/1.11.0/src/manipulation.js#L684-709