i trying to add a tooltip on select option 
Can any one help 
below is code 


<html>

<head>

<title>test</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" ></script>

<script type="text/JavaScript">

$(function () {

$("#sel option").each(function(i){

if(i>0){

var title="The select val=" +$(this).val();

$(this).attr("title",title);

}

});
} );
</script>

</head>

<body>

<select id="sel">

<option Value="One">One</option>

<option Value="Two">Two</option>

<option Value="Three">Threee</option>

<option Value="Four">Four</option>

<option Value="Five">Five</option>

</select>

</body>

</html>

deepu Default Asked on November 20, 2018 in Programming.
Add Comment
  • 2 Answer(s)
    
     <html>
    <head>
    <title>test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script type="text/javaScript">
    $(function () {
      var $elements = $('#sel option');
    $.each($elements.slice(1, $elements.length), function(i, el) { 
        var $this = $(el); 
          $this.attr('title', ['She select val=', $this.val()].join('')) 
      }); 
    } );
     </script>
    </head>
    <body>
    <select id="sel">
    <option Value="One">One</option>
    <option Value="Two">Two</option>
    <option Value="Three">Threee</option>
    <option Value="Four">Four</option>
    <option Value="Five">Five</option>
    </select>
    </body>
    </html>
    
    Gutelaunetyp Default Answered on November 23, 2018.
    Add Comment

    Hi! I need your help, too. I recently created a blog australia pokies on the Internet where I share my experience in the world of gambling with my readers. It is important for me to find out what people think about my blog and its interface. you will help me a lot if you give me feedback on this. Thanks!

    Karolina90 Default Answered on October 13, 2020.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.