I have a question about deleting attributes.
Below is an html statement.
I'd like to delete the id="newsite" in the tag using javascript, what should I do?
I look forward to your kind cooperation.
menu.html
<ons-list-item id="newsitem"
modify="tappable" class="list_item__line-height"
onclick="app.slidingMenu.setMainPage('news.html', {closeMenu:true})">
<i class="fa fa-list fa-lg" style="color:#666"></i>
News
</ons-list-item>
To delete an attribute, run the removeAttribute()
method for the element.
varm= document.getElementById("newsiteem");
elm.removeAttribute("id");
© 2024 OneMinuteCode. All rights reserved.