Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js double click to edit

document.querySelectorAll("table tr:nth-child(2) td").forEach(function(node){
	node.ondblclick=function(){
		var val=this.innerHTML;
		var input=document.createElement("input");
		input.value=val;
		input.onblur=function(){
			var val=this.value;
			this.parentNode.innerHTML=val;
		}
		this.innerHTML="";
		this.appendChild(input);
		input.focus();
	}
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: React Redux reducer crud 
Javascript :: load all icon from a folder in react 
Javascript :: vue router Async Scrolling 
Javascript :: vue.js props undefined type 
Javascript :: javascript Use clearTimeout() Method 
Javascript :: Implementing state lifecycle in react class component 
Javascript :: version check 
Javascript :: package.json 
Javascript :: ajax post csrf codeigniter 
Javascript :: loadstring json flutter 
Javascript :: js closure 
Javascript :: how to update specific key of an object in reducer 
Javascript :: vue nexttick 
Javascript :: react js require pasword to have special charaacter 
Javascript :: angular blank page no errors 
Javascript :: javascript if 
Javascript :: transition scrolling 
Javascript :: Write Number in Expanded Form 
Javascript :: ondragover js 
Javascript :: mongoose discriminator 
Javascript :: req.body is empty express js 
Javascript :: javascript find first element of array 
Javascript :: jquery append method 
Javascript :: update object within object by id js 
Javascript :: set VS Code SSH Remote shell to zsh 
Javascript :: angular inject token 
Javascript :: react sticky hook 
Javascript :: iterate array 
Javascript :: in if condition how to set alert music in javascript 
Javascript :: hide and open jquery 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =