Created
November 9, 2018 16:44
-
-
Save Dushusir/e90646275439365dbcb2af54cbfbeb91 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/maqacuc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
#span1{ | |
margin-top:200px; | |
} | |
</style> | |
</head> | |
<body> | |
<input id="searchBarInput" type="search" class="weui-search-bar__input" placeholder="搜索" required=""> | |
<span id="span1"></span> | |
<script id="jsbin-javascript"> | |
function $$(selector, context) { | |
context = context || document; | |
var elements = context.querySelectorAll(selector); | |
return elements.length == 1 ? Array.prototype.slice.call(elements)[0] : Array.prototype.slice.call(elements); | |
} | |
$$("#searchBarInput").addEventListener("keyup", function(e) { | |
$$("#span1").innerHTML = e.target.value; | |
}) | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<input id="searchBarInput" type="search" class="weui-search-bar__input" placeholder="搜索" required=""> | |
<span id="span1"></span> | |
</body> | |
</html> | |
</script> | |
<script id="jsbin-source-css" type="text/css">#span1{ | |
margin-top:200px; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function $$(selector, context) { | |
context = context || document; | |
var elements = context.querySelectorAll(selector); | |
return elements.length == 1 ? Array.prototype.slice.call(elements)[0] : Array.prototype.slice.call(elements); | |
} | |
$$("#searchBarInput").addEventListener("keyup", function(e) { | |
$$("#span1").innerHTML = e.target.value; | |
})</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#span1{ | |
margin-top:200px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function $$(selector, context) { | |
context = context || document; | |
var elements = context.querySelectorAll(selector); | |
return elements.length == 1 ? Array.prototype.slice.call(elements)[0] : Array.prototype.slice.call(elements); | |
} | |
$$("#searchBarInput").addEventListener("keyup", function(e) { | |
$$("#span1").innerHTML = e.target.value; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment