Created
March 18, 2017 20:43
-
-
Save stisa/6e56afa0b8bd2ef0c203253df053b8d3 to your computer and use it in GitHub Desktop.
Nim js backend: input element
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
<html> | |
<body> | |
<input id="input" type="text" name="fname"> | |
<script src="nimcache/t.js"></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
import dom | |
type Input = ref object of Element | |
value: cstring | |
`type`: cstring | |
var inp = document.getElementById("input").Input | |
inp.value = "hello" | |
echo inp.type |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment