Home >Backend Development >PHP Tutorial >一个js有关问题,希望大家帮忙

一个js有关问题,希望大家帮忙

WBOY
WBOYOriginal
2016-06-13 10:15:25750browse

一个js问题,希望大家帮忙
我有一个图层是叫



他想通过js把 class="demo" 替换成 id="demo"

但是var str=" "这里怎么写才能好吗?

------解决方案--------------------
先找到该对象, obj.id='demo'; obj.className='';
------解决方案--------------------
你原来已经有id了是吗?
?
要修改成
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:这个一般如何做Next article:php的urlencode有关问题