Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get the input text field value on tooltip

Get the input text field value on tool-tip.for me I am using text-box with autocomplete..when ever i selected in autocomplete it will show in text-box. when i hover it i want tool-tip the value in text-box..how to get that one can anyone can help me

<input type="text" value="something" class="curate">
like image 725
Ravi Kumar Avatar asked Sep 13 '25 09:09

Ravi Kumar


1 Answers

Use the title attribute and pass the value of the input into the it on the keyup event.

$(document).ready(function(){
  $('#testInput').keyup(function(){
    $(this).attr('title',$(this).val())
  })
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Type Something
<input type="text" title="" value="" id="testInput">
like image 160
gavgrif Avatar answered Sep 15 '25 00:09

gavgrif