Home » check dropdown contains in jquery

check dropdown contains in jquery

Today, We want to share with you check dropdown contains in jquery.In this post we will show you javascript check if option exists in selec, hear for jquery check if specific option is selected we will give you demo and example for implement.In this post, we will learn about check if select option is empty javascript with an example.

check dropdown contains in jquery

There are the Following The simple About check dropdown contains in jquery Full Information With Example and source code.

Read Also:  Angular 6 HttpClient Loading Spinner Example

As I will cover this Post with live Working example to develop jquery check if dropdown contains text, so the check if dropdownlist contains value for this example is following below.

jquery contains class

index.html

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>jquery check if dropdown contains text - pakainfo.com</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>  
<script type="text/javascript">
function programData(currentObj,newObj){
 currentObj.disabled=true;    
 currentObj.style.display='none';
 newObj.disabled=false; 
 newObj.style.display='inline';
 newObj.focus();
}
</script>
<style type="text/css">
html, body {
    height: 50%;
}

html {
    display: table;
    margin: auto;
}

body {
    display: table-cell;
    vertical-align: middle;
  background:#fafafa;

}
</style>
</head>
<body>
<h1>jquery check if dropdown contains text</h1>
<hr/> <br/>http://jsfiddle.net/6nq7w/4/
<form name="BrowserSurvey" action="#">
Browser: <select name="browser" onchange="if(this.options[this.selectedIndex].value=='customOption'){programData(this,this.nextSibling); this.selectedIndex='0';}">
  <option></option>
  <option value="customOption">[type a custom value]</option>
  <option>AngularJS</option>
  <option>VueJS</option>
  <option>HTML & PHP</option>
  <option>Laravel</option>
  <option>Safari</option></select><input name="browser" style="display:none;" disabled="disabled" onblur="if(this.value==''){programData(this,this.previousSibling);}">
<input type="submit" value="Submit">
</form>
</body>
</html>

Angular 6 CRUD Operations Application Tutorials

Read :

Read Also:  Yii Framework Introduction and Hello World Tutorial

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about check dropdown contains in jquery.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.


Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  print a specific area of the web page using jQuery
  2. Read Also:  DropZone Allowed File Extensions Tutorials
  3. Read Also:  Time Ago Function Helper Class in PHP
  4. Read Also:  HTTP Session Management Using Laravel
  5. Read Also:  PHP laravel open new tab Example Tutorial
  6. Read Also:  jQuery Dynamically addClass and removeClass
  7. Read Also:  Angular 6 Templating Tutorial with Examples
  8. Read Also:  jQuery change class Examples with Demo
  9. Read Also:  jQuery Find Nested Parent Child Elements HTML DOM
  10. Read Also:  5 Star Product Rating Review Widget in CSS

Leave a Comment

Your email address will not be published. Required fields are marked *