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.

  Get Responsive navbar menu to Automatically close after anchor link clicked

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 :

  javascript Manage cookies setcookie and getcookie

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.

Leave a Reply

avatar
  Subscribe  
Notify of