Skip to content

Tag: html

JavaScript get word before cursor

Okay, I’ve been looking all over the web to find a solution but I couldn’t find one, is there a way to get the word before the caret position in an editable div so a bit like: This should return the word “some”… I don’t know if this is possible, I would be glad for any help…

How to reset/uncheck radio button onclick event?

I have 2 radio button with 2 group. The structure is like this Main Radio 1 Main Radio 2 Under Main Radio 2, there’s two more sub radio button. Main Radio 1 Main Radio 2 Sub Radio 1 Sub Radio 2 What am I doing is, in default stage, it will only show Main Radio 1 and Main Radio 2

HTML5 – passing Canvas between files

I have two html files, say 1.html and 2.html with 1.js and 2.js referenced javascripts. In 1.html I have a Canvas object with drag and drop functionality, so that i use drawImage method for adding additional images to the canvas. When I am finished with adding images on 1.html, i save the canvas to the localS…

Disable scrolling on “

Is it possible to disable the scroll wheel changing the number in an input number field? I’ve messed with webkit-specific CSS to remove the spinner but I’d like to get rid of this behavior altogether. I like using type=number since it brings up a nice keyboard on iOS. Answer Prevent the default be…

Pass a string parameter in an onclick function

I would like to pass a parameter (i.e. a string) to an Onclick function. For the moment, I do this: with result.name for example equal to string “Add”. When I click on this button, I have an error that says that “Add is not defined”. Since this function call works perfectly with a nume…

Falling hearts animation for browsers

Recently I have downloaded falling hearts animation from this . I have pasted the code below too. It simply displays a heart in my page.and falling hearts animation is not working.I am not able to identify the problem. will anyone tell me what changes I have to made in order to get the hearts falling animatio…