JavaScript Regex tester

This is a little JavaScript Regex tester, just write your Regex as example "\d" or "\w" and a test string like "123abc". It is more like an example as an real use function, but you can see how it works and handle the matches. Try it:

Matches:
Code:

JavaScript generate and delete html inputs

This generates a new text box with a unique id if you hit the Add button, but if you hit the remove button it removes the last text box.
Try it:

    The count function counts the current text boxes, I used XPATH for this and then iterate trough the results to count them.

JavaScript replace all

This is a little example how to replace all matches with replace.

Click the button to replace "i" with "X" in the paragraph below:

Visit Microsoft!

 

Calculator JavaScript

This is a little example about a JavaScript Calculator, he could calculate some simple things another solution is to use eval.





JavaScript code:   HTML code:

HTML select on-change event JavaScript

This is an example how to get the index and selected text from a select in html:

Try it:

Code:

JavaScript series resistor circuit calculator

This is a JavaScript calculator how calculate with the ohm's law the voltage, ampere and the resistance.Its only an example but feel free to copy change or reuse this script. Try it:










UG-U1 U2
UG-U2 U1
U1+U2 UG
RG-R1 R2
RG-R2 R1
R1+R2 RG
(UG*R1)/RG U1
(UG*R2)/RG U2
UG/RG IG
U1/R1 IG
U2/R2 IG
(R1*U2)/R2 U1
(R2*U1)/R1 U2
(R2*U1)/U2 R1
(R1*U2)/U1 R2
UG/IG RG
UG/RG IG
RG*IG UG
Code:

JavaScript parallel resistor circuit calculator

This is a JavaScript calculator how calculate with the ohm's law the voltage, ampere and the resistance.Its only an example but feel free to copy change or reuse this script. Try it:










RG=1/(1/R1+1/R2)
R1=-1/(1/R2-1/RG)
R2=-1/(1/R1-1/RG)
I1=(I2*R1)/R2
I2=(I1*R2)/R1
R1=(I1*R2)/I2
R2=(I2*R1)/I1
I2=(IG/(R1+R2))*R1
I1=(IG/(R1+R2))*R2
Code:

HTML store data in data tag

If you want to store some data in a tage you could use the data- tag. try it:

1


code:  

HTML Mail to line break

If you want to make a line break in the mail body to you could use this: its just a line feed and carriage return. For white spaces you could use this: for more information look at RFC 2368   This is a little example:   Try it: Mail to  

Grease monkey open url with JavaScript

I use this JavaScript and XPATH with Greasemonkey to open the urls on Piratebay or other pages, if you open a torrent in a new tab the script search for urls containign "imagecurl.org", "imgcrl.org" or "pixoverflow" then wait 10 seconds and open the url.This saves time, just open all what’s interesting in a new tab then just look at the images :