Ok so i have this 开发者_开发知识库
<select class="something">
  <option value=''>
    Select a Project
  </option>
    ---
  </option>
  <option value="/projects/2">test</option>
  <option value="/projects/3">test2</option>
  <option value="/projects/4">test7</option>
  <option value="/projects/5">test5</option>
When someone clicks the Select a Project how would popup a lightbox just for that and not if they select the others....Popping up the lightbox is not too hard its distinquishing from the other options that i dont understand
$(".something").change
this will get all but i only want "Select a Project"
$('.something').change(function() {
   if ($(this).val() == '') {
      // Your code here:
   }
});
Here's how I'd do it:
$(".something").bind("change", function(eventObj) {
    if($(":selected",this).text() === "Select a Project") {
        // open lightbox
    }
});
I like checking .val() in most cases, but if your value is an empty string...I feel iffy about it so I would check against the text of the selected option in this case.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论