I have an element that already has a class: 我有一个已经有一个类的元素: html
<div class="someclass"> <img ... id="image1" name="image1" /> </div>
Now I want to create a JavaScript function that will add a class to the div
(not replace, but add). 如今,我想建立一个JavaScript函数,该函数将向div
添加一个类(不是替换,而是添加)。 ide
How can I do that? 我怎样才能作到这一点? 函数