test1.nim 354 B

1234567891011121314151617181920212223
  1. discard """
  2. output: "1261129"
  3. """
  4. # This file tests the JavaScript generator
  5. import
  6. dom, strutils
  7. var
  8. inputElement = "1123"
  9. proc onButtonClick(inputElement: string) {.exportc.} =
  10. let v = $inputElement
  11. if v.allCharsInSet(WhiteSpace):
  12. echo "only whitespace, hu?"
  13. else:
  14. var x = parseInt(v)
  15. echo x*x
  16. onButtonClick(inputElement)