Example Analysis of className and a href in javascript
This article mainly shows you the "sample analysis of className and a href in javascript", which is easy to understand and clear. I hope it can help you solve your doubts. Let the editor lead you to study and study the "sample analysis of className and a href in javascript".
JS and a href
Pay attention to the end of the semicolon and the closing of quotation marks in href
Empty link pop-up
Generally might as well code, generally let it empty. You can also use the pound sign'# 'when it is empty, but it is not very good.
ClassName#div1 {width:100px; height:100px; border:1px solid black;} .box {background:red;} function toRed () {var oDiv=document.getElementById ('div1'); oDiv.className='box'; / / do not write as class}