IsNaN (), in which a parameter is passed to determine whether the value passed in is a number. Can be used to make some simple form judgments.
You can get the content of span with innerHTML, and you can set the content of span. In fact, all non-form elements can be innerhtml to get their content
Example:
<!DOCTYPE HTML><HTML> <HeadLang= "en"> <MetaCharSet= "UTF-8"> <style>span{Display:Inline-block;width:100px;Height:50px;Line-height:50px;text-align:Center;Border:1px solid Orange; } </style> <Body> <spanID= "Span1">Red flag</span> <Script> varSpan1=document.getElementById ("Span1"); alert (span1.innerhtml); Span1.innerhtml= "I love you ."; </Script> </Body></HTML>
You can use JS to set the class name of an element, usage: element.classname= "xxx", so that if the corresponding class name has some style attribute, the element will apply these attributes, save us to use JS sentence to set the style for this element.
JS some small knowledge points