I am very new to JavaScript, and can't seem to solve a problem.
I've created a form that looks like this:
<form>
<p>
<input type="button" value="CR" ID="CR" onClick= "window.location='http://localhost/test1/html_CR.html'" />
</p>
<input type="button" value="CRI" ID="CRI" onClick= "window.location='http://localhost/test1/html_CR.html'" />
</p>
<input type="button" value="ALL" ID="ALL" onClick= "window.location='http://localhost/test1/html_CR.html'" />
</p>
</form>
I would like to create a function objectType(obj) that can include those 3 onClick events. It should look something like onClick= objectType(obj), where obj can have 3 values: CR, CRI and ALL.
Can someone help me?
onclickevent is the same on all three buttons. Is it supposed to be?