Use jQuery to implement double-click table editing function
This article introduces you to everyone through example codejquery Double-click to editForm, friends who need it can refer to it
First I will show you the rendering:
The following is a simple form editing function implemented in a simple way:
The simple HTML code is skipped, the following is the js implementation process
<span style="font-size:18px;">$(".tables").on("dblclick","td",function(){ if($(this).children("input").length>0){ return false; } var tdDom = $(this); //保存初始值 var tdPreText = $(this).text(); //给td设置宽度和给input设置宽度并赋值 $(this).width(100).html("<input type='text'>").find("input").width(100).val(tdPreText); //失去焦点的时候重新赋值 var inputDom = $(this).find("input"); inputDom.blur(function(){ var newText = $(this).val(); $(this).remove(); tdDom.text(newText); });</span>
The above is the detailed content of Use jQuery to implement double-click table editing function. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Does anyone know how to edit documents in Tencent Docs? It doesn't matter if you don't know. Today, the editor will introduce detailed graphic explanations on how to edit documents in Tencent Docs. I hope it can help you. Detailed graphic explanation of editing documents in Tencent Documents 1. First, enter Tencent Documents directly (if you don’t have it, download it now!) and log in directly (QQ and TIM two login methods are supported) 2. After logging in, click Add in the upper right corner No., directly create online documents, online forms, new folders, etc.! 3. Then enter the information according to your needs!

After editing the document, we will save the document to provide convenience for editing and modifying the document next time. Sometimes we can modify it directly after clicking on the edited document, but sometimes for some unknown reason, there is no response no matter how we click on the word document, and the command will not be executed. , what should I do if the word document cannot be edited? Don’t worry, the editor will help you solve this problem. Let’s take a look at the operation process. After opening a Word document, when editing text, you will see a "Restrict Editing" prompt displayed on the right side of the page, as shown in the figure below. 2. You need to cancel editing and you need to know the set password. Click "Stop Protection" below the pop-up prompt, as shown in the figure below. 3. Then enter the password in the "Unprotect Document" dialog box and click OK, as shown in the figure below.

Meizu 21Pro's operating system Flyme also provides a wealth of personalization options, allowing users to customize according to their own preferences and habits. Among them, the double-click lock screen function is a very practical setting that allows users to quickly lock the screen and protect the security of the phone. Next, we will introduce how to set up the double-click lock screen function on Meizu 21Pro to make your phone more convenient to use. How to set double-click lock screen on Meizu 21pro 1. Enter [Settings]-[Accessibility]-[Gesture Wake], click the switch on the right side of [Gesture Wake] to control the black screen gesture function on or off. 2. On the system desktop-Settings-Fingerprint and Security, set the lock screen password or enter the fingerprint. If there is no fingerprint unlock function, go to Settings-Security.

1. First we need to make some settings, and then try to double-click to open. Right-click the Start menu and select [Command Prompt (Administrator)] to open it. 2. Open the administrator command prompt interface and enter assoc.exe=exefile, as shown in the figure. 3. Press Enter, exe=exefile appears, as shown in the figure. 4. Now the file with the suffix name exe can be opened by double-clicking the mouse. 5. If that still doesn't work, you can use anti-virus software to scan the computer to rule out whether it is caused by a virus.

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

How to remove the height attribute of an element with jQuery? In front-end development, we often encounter the need to manipulate the height attributes of elements. Sometimes, we may need to dynamically change the height of an element, and sometimes we need to remove the height attribute of an element. This article will introduce how to use jQuery to remove the height attribute of an element and provide specific code examples. Before using jQuery to operate the height attribute, we first need to understand the height attribute in CSS. The height attribute is used to set the height of an element

1. Make preparations. Import a piece of material into the material library and drag it to the timeline. 2. Click the [T] button on the timeline track, choose to add subtitles on the 1T track, and you will enter the subtitle editing page. The operation is as shown in the picture: 3. Here you can write the text content we want. It is obvious that the subtitles are written horizontally. Now let’s take a look at how to implement vertical subtitles. Don't write the content yet, select [Insert - Text - Vertical] as shown in the picture: 4. Now write the words and it will be arranged vertically. After adjusting the position, size, font, color and other information of the subtitles, click Save in the upper left corner of the window.

1. Right-click the Start menu and open Command Prompt (Administrator). 2. After opening the command prompt window, enter the assoc.exe=exefile command and press Enter. 3. At this time, .exe=exefile appears, indicating that the association is successful. Finally, double-click the application to open it smoothly.
