Welcome To Snipplr


Everyone's Recent JavaScript Snippets



1 ... 53 54 55 56 57 ... 65
Adds commas to numbers. 1234567 becomes 1,234,567
1 1958 posted 17 years ago by jdstraughan
Useful functions to get around browser incompatibilities when working with stylesheets. If you find any errors, please leave a comment.
0 1285 posted 17 years ago by wizard04
sample: var text = " string content "; text = text.trim();
2 1180 posted 17 years ago by donkeykong
Use sample: var inputTxt = getElementsByAttr('input', 'type', 'text');
1 1143 posted 17 years ago by kcmr
Determines if a given element is visible, by checking a variety of things. Will work for CSS or inline style declarations of visible:hidden or display: none. Will check if it's inside of an invisible element, as well.
3 1804 posted 17 years ago by TALlama
1 1137 posted 17 years ago by wesbaker
1 1022 posted 17 years ago by zb3k
Firefox ignores the alt tag on images and uses the title tag whereas IE uses the alt tag. This javascript code copies the text in all image alts to the image's title. Best when placed at the footer of each page
1 1449 posted 17 years ago by ezerick
1 1248 posted 17 years ago by rwczippy
1 1274 posted 17 years ago by ezerick
I made this simple JavaScript to save me time. I was sick of having to thumb-bash on a tiny keypad or login to the slow Clickatell site and use their clunky interface (nothing it simpler than 2 text boxes and an OK button). You will need an HTTP A...
1 1349 posted 17 years ago by mountainash
0 1069 posted 17 years ago by cczona
When there's a value in a textbox, like 'search', it disappears when you click on it, and reappears when you leave (blur) it. But only if you haven't filled in anything ofcourse. Use it like this:
1 1023 posted 17 years ago by jeppeb
You'll need to download the latest version of jQuery for this to work, as it is linked in the tag. CSS/XHTML included.
15 4061 posted 17 years ago by dmosher
0 1115 posted 17 years ago by IanLewis
I wrote this very quickly for a form I parse that allows a user to send a page to up to 5 friends. The script adds a click event to an image of a + sign beside an input box. When clicked if the user hasn't already added 5 friends to email, additional...
9 1735 posted 17 years ago by dmosher
Usage:
1 1228 posted 17 years ago by mattkenefick
Just to include and implement the SWFObject to an HTML body from a generic "/js/" directory with some basic varibles. [applies to OLD version of SWF Object]
1 1091 posted 17 years ago by mattkenefick
1 1237 posted 17 years ago by Juego
7 3328 posted 17 years ago by Juego
1 ... 53 54 55 56 57 ... 65