Implementation Code _ jquery

Source: Internet
Author: User
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
});
});
})

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.