Skip to content

Instantly share code, notes, and snippets.

@ergurjeetsingh
Created June 21, 2018 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ergurjeetsingh/abe7f72ca1272010d414b59f7acd6d3d to your computer and use it in GitHub Desktop.
Save ergurjeetsingh/abe7f72ca1272010d414b59f7acd6d3d to your computer and use it in GitHub Desktop.
add value
<!DOCTYPE html>
<html>
<head>
<script src="jquery-3.3.1.js"></script>
<title>remove</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
</head>
<body>
<div class="container">
<div class="row mt-5">
<div class="col-lg-6">
<input placeholder="input-1" class="input-1 form-control" type="text" name="text" value="">
</div>
<div class="col-lg-6">
<input placeholder="input-2" class="input-2 form-control" type="text" name="text" value="">
</div>
<div class="clearfix mb-5"></div>
<div class="col-lg-6">
<input placeholder="input-1" class="input-1 form-control" type="text" name="text" value="">
</div>
<div class="col-lg-6">
<input placeholder="input-2" class="input-2 form-control" type="text" name="text" value="">
</div>
<div class="clearfix mb-5"></div>
<div class="col-lg-6">
<input placeholder="input-1" class="input-1 form-control" type="text" name="text" value="">
</div>
<div class="col-lg-6">
<input placeholder="input-2" class="input-2 form-control" type="text" name="text" value="">
</div>
</div>
</div>
<script type="text/javascript">
$(document).on('keyup','.input-2',function(){
// alert(123);
textbox2 = $(this).val();
// $(this).
$(this).parent('.col-lg-6').prev('.col-lg-6').children('.input-1').val(textbox2);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment