Skip to content

Commit

Permalink
docs(demo): trigger "randomNumber" function on page load
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoee committed Sep 5, 2022
1 parent a1af6ac commit f6f219b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ <h4>Example</h4>
$result.html(html)
}

function init() {
function randomNumber() {
const num = r.real(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)
$number.val(num)
updateResult()
}

$(document).ready(function() {
init()
// init
randomNumber()

// number
$number.on('input', function(e) {
Expand All @@ -88,9 +91,7 @@ <h4>Example</h4>

// random
$random.click(function(e) {
const num = r.real(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)
$number.val(num)
updateResult()
randomNumber()
})

// example
Expand Down

0 comments on commit f6f219b

Please sign in to comment.