


How to select elements whose attributes are not equal to a certain value or do not have the attribute_html/css_WEB-ITnose
For example
<div> <vbox name="xxx" /> <vbox /> <vbox /></div>
How to select two vboxes without name attribute
Reply to discussion (solution)
Although it can be taken out in this way, the lower version of IE does not seem to support this kind of tag. Use with caution.
<div id="div"> <vbox name="xxx" ></vbox> <vbox></vbox> <vbox></vbox></div><script type="text/javascript"> var div = document.getElementById('div'); var box = div.getElementsByTagName('vbox'); var arr = []; for(var i = 0; i < box.length; i++){ if(!box[i].getAttribute('name')){ arr.push(box[i]); } } console.log(arr);</script>
Use xpath
//vbox[not(@name)]
Use jQuery
$('vbox:not([name])')
$('vbox:not([name])')
It is recommended that you use the universal jquery
$('vbox:not([name])')
It is recommended that you use the universal jquery
1.
Use xpath
//vbox[not(@name)]
Use jQuery
$('vbox:not([name])')
Sorry, add
to use CSS selector
use xpath
//vbox[not(@name)]
Use jQuery
$('vbox:not([name])')
Sorry, add
You need to use CSS selector
Try it
vbox:not([@name])
The following jQuery is a CSS selector. If you use jQuery, you should be able to take out the elements you need. I have tested it before replying yesterday. You can click to view the demo code
If you use other js frameworks, you can tell me.
Use xpath
//vbox[not(@name)]
Use jQuery
$('vbox:not([name])')
Sorry, add
to use CSS selector
not

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.
