Para ver cada ejemplo:
Haga clic en el enlace de abajo y cargar el ejemplo de esta ventana.
A continuación, para ver el código fuente:
Haga clic en el botón derecho del ratón sobre la ventana y seleccione "Ver código fuente" de la ventana emergente.
Si alguno de los gráficos se utilizan en el guión:
Haga clic en el botón derecho del ratón sobre cada gráfico y seleccione "Guardar imagen como" del menú emergente. (Todos los gráficos se incluyen en el mismo directorio que el ejemplo de Javascript.)
Para volver al Indice:
Haga clic en el botón "Atrás" en la parte superior de su navegador.
Alert Button This is probably the simpliest Button JavaScript. Copy 4 lines of HTML into your document and you have a button alert! The button can have different words on it and the message can also be customized.
Apologize Mail This script, when activated, makes the user send an apologetic e-mail - whether they like it or not! Very funny, but has no real use.
Button Link This short script will turn an ordinary button into a link to any page.
Check All Dynamically checks and unchecks all the checkboxes in a form when a button is clicked. Much easier than manually hard-coding the checkbox names, for sure. Updated to only require one button to check and uncheck all boxes.
Click To Submit Prevent the Return key from accidentally submitting a form. The user now MUST click on the submit button.
Directions This effect is practically never used. 6 lines of HTML give you back and forward buttons that act exactly like the ones in your web browser.
Email A JavaScript button will bring up an E-Mail Window for your users. You can also include a predefined subject if you so decide. Both methods are demonstrated.
Fading Button (Internet Explorer Only) Move your mouse over the button and watch it fade to another color and then fade back to original color once you move your mouse off. The message on the button will even change after you click on it!
Headliner Appropriately named the Headliner, it presents a number of messages to your visitors in many different formats including a simple scroll, typewriter, expand, and just static text. Each message when clicked can take the visitor to a different URL!
Image Button Easily create active buttons with any image. Repositions image when your mouse passes over it and moves again when clicked on.
Mrpushme Let JavaScript introduce you to the increasingly popular Mr. Push Me! Mr. Push doesn't mind the occassional push, but watch out if you over do it!
Position Do you not like where opens your new windows? Using this JavaScript, you can actually have the new window open wherever you want!
R Link Check out this random link generator! It randomly selects a URL from a pre-determined list and sends the user there!
Textarea Use JavaScript to alert your user with the contents of a textarea box! This serves little purpose in the real world, but nonetheless is a great example of JavaScript. Type something in the box and hit Alert Me!
Up Down Box Allows the user to increase and decrease the value in a textbox by clicking up and down buttons. Useful if you would like to allow the user to quickly modify a value in your form.
Window Sizer This is a JavaScript that shows you different window dimensions. It helps you to customize your web pages with the dimensions that best compliment your web site.