In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to remove the elements without ID in HTML, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
Remove the HTML without ID elements: 1, use the "$(" parent element ") .children (": not ([id]) ") statement to get all the elements that need to be removed without ID; 2, use the remove () method to delete the acquired elements, and the syntax" elements without ID .remove () ".
The operating environment of this tutorial: windows7 system, HTML5&&jquery1.10.2 version, Dell G3 computer.
Remove elements in HTML that do not have ID
You can use selectors and methods in jquery to implement the code:
$(document) .ready (function () {$("# but") .click (function () {$("div") .children (": not ([id])") .remove ();}) No id title, no id title, no id div, id div.
Paragraphs without id
There are paragraphs with id.
Remove elements without ID
Description:
The children () method returns all direct child elements of the selected element.
The not () selector selects all elements except the specified element.
The [attribute] selector selects each element with the specified attribute.
The remove () method removes the selected element, including all text and child nodes.
Thank you for reading this article carefully. I hope the article "how to remove the elements without ID in HTML" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.