Skip to content

Instantly share code, notes, and snippets.

@JGaudette
Created June 21, 2018 20:09
Show Gist options
  • Save JGaudette/5ea30cddc586f20d2fad2f808aba4a00 to your computer and use it in GitHub Desktop.
Save JGaudette/5ea30cddc586f20d2fad2f808aba4a00 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/kobepap
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="input over <everything></everything>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
#container{
width: 200px;
height: 200px;
background-color: red;
position: relative;
}
#txtbox{
opacity: 0.01;
position: absolute;
left:0;
right:0;
top:0;
bottom:0;
width: 100%;
}
</style>
</head>
<body>
<div id='container'>
<input type='text' id='txtbox' />
<input type='text' id='targetbox' />
</div>
<script id="jsbin-javascript">
var container = document.getElementById('container');
container.onclick = function(){
console.log('container');
var tgt = document.getElementById('targetbox');
tgt.focus();
};
</script>
<script id="jsbin-source-css" type="text/css">#container{
width: 200px;
height: 200px;
background-color: red;
position: relative;
}
#txtbox{
opacity: 0.01;
position: absolute;
left:0;
right:0;
top:0;
bottom:0;
width: 100%;
}</script>
<script id="jsbin-source-javascript" type="text/javascript">var container = document.getElementById('container');
container.onclick = function(){
console.log('container');
var tgt = document.getElementById('targetbox');
tgt.focus();
};
</script></body>
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
</html>
#container{
width: 200px;
height: 200px;
background-color: red;
position: relative;
}
#txtbox{
opacity: 0.01;
position: absolute;
left:0;
right:0;
top:0;
bottom:0;
width: 100%;
}
var container = document.getElementById('container');
container.onclick = function(){
console.log('container');
var tgt = document.getElementById('targetbox');
tgt.focus();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment