Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:44:00+00:00 2026-06-17T08:44:00+00:00

I am reconfiguring a complicated HTML document with 100+ input elements. I’d like to

  • 0

I am reconfiguring a complicated HTML document with 100+ input elements. I’d like to quickly find any elements that either have a blank id (<input type="text" name="something" id="" ...), an id with only whitespace (<button name="unimportant" id=" "...), or no idea at all (<select name="whatever"> so that I can make the necessary corrections to the source.

I know that the selector for blank id would be $('[id=""]'), but how can I get all the target elements with one selector (or concatenated selectors)?

Example HTML:

<form id="provision">
  <input type="text" name="something" id="" value="blank id" /><br />
  <input type="text" name="something2" value="no id" /><br />
  <select name="something3"><option>No id</option></select><br />
  <textarea name="something4" id="">Blank id</textarea><br />
  <button name="something5" id=" ">whitespace id</button><br />
  <button name="something6" id="  ">extra whitespace id</button><br />
  <label><input type="radio" name="something7" id="
">Carriage return id</label>
</form>

Please see http://jsfiddle.net/jhfrench/VNdL6/ for an example that adds red borders (.css('border-color', 'red')).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:44:01+00:00Added an answer on June 17, 2026 at 8:44 am

    You can use filter() to filter out element with blank ids or ids consists of spaces. You can apply the complex filters according to your need in filter function.

    $(':input').filter(function(){
         if($.trim(this.id).length == 0)
               return $(this);
    }).css('border-color', 'red')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any option to have Virtual COM port Host on Android that would
I'm reconfiguring a build server that someone else setup a long time ago to
first time poster, but please help. I have been searching and reconfiguring for 6
We have a self-signed certificate on our IIS7 server that is due to expire
A suite of integration services that use NServiceBus have been dropped in my lap
We have unit tests (mockito) and integration tests (in-memory database) We'd like maven to
I have a function that makes HTTP requests with cURL that falls back to
I need to write an application that acts as a proxy between a client
I can't see anything on here but I do remember being told that If
I have written some software which uses Wifi as a possible internet-connection medium.. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.