This effect is often found on Web pages. When you move your mouse into an input box, a dialog box will pop up asking you to choose to enter the value of this dialog box. Now we can simply implement this effect using Jquery.
The Code is as follows:
Get value:
Number |
Last name |
First name |
2 |
Xing |
Ge |
3 |
Xingad |
Gead |
4 |
Xingxing |
Ge |
Number |
Last name |
First name |
Next we will write some JS Code to implement this function:
The Code is as follows:
$ (Document). ready (function (){
$ ("# Inputname"). focus (function (){
// Alert ('focal ');
$ ("# Getvalue" ).css ("display", 'block') // display the table
. AddClass ('hover ')
. Find ('table tr'). dblclick (function () {// double-click table tr
Var text = $ (this). find ("td: eq (0)"). text (); // obtain the first text value of table td
// Alert ($ text );
$ ("# Getvalue" ).css ('display', 'None'); // hide the table
$ ("# Inputname"). val (text); // assign an Input value
});
});
})