JSFiddle - React, Tailwind, and code Playground

by Prasad Gavande

HTML

<!-- move with changin the css ---------------
----------------------------------->
<div id="panel1">
    <input type="button" value="first Name" id="btn1" />
    <br>
    <input type="button" value="Last name" id="btn2" />
    <br>
    <input type="button" value="contact" id="btn3" />
</div>

JavaScript

var flag = 0 ; 
	$("input").click(function () {		
	//flag = 0 ;
		//$(this).css("margin-left","120px");
			
			if( flag ==1 )
			{
				$(this).click(function () {	
				$(this).css("margin-left","0px");});
				flag=0;
			}
			else if( flag == 0)
			{
			$(this).click(function () {	
				$(this).css("margin-left","120px");});
				flag = 1 ; 
			}
		
	});