I am facing an issue , my inline javascript code is not added in page(Created By wordpress).
code
function check()
{
alert("in check");
var mname=document.getElementByID("name").value;
var memail=document.getElementByID("email").value;
var mresponse=document.getElementByID("response").value
alert("name"+mname +"length" +mname.length+"email"+memail+"length"+memail.length+"response"+mresponse+"length"+mresponse.length);
}
</script>
<table style="border: 0px;">
<tbody>
<tr>
<td style="border: 0px;">Name <span style="color: red;">*</span></td>
<td style="border: 0px;"><input id="name" type="text" name="name" /></td>
</tr>
<tr>
<td style="border: 0px;">Email-Id <span style="color: red;">*</span></td>
<td style="border: 0px;"><input id="emailid" type="text" name="emailid" /></td>
</tr>
<tr>
<td style="border: 0px;">Your Response <span style="color: red;">*</span></td>
<td style="border: 0px;"><textarea id="response" cols="40" maxlength="50" name="response" rows="4"></textarea></td>
</tr>
</tbody>
</table>
<input onclick="check();" type="button" value="click" />
Do i need to install any plugin for allowing java script.
P.S i am not using wordpress.com ..i am developing locally
**********Updated*****************
i just try alert box
var mname=document.getElementById("name");
alert("in check"+mname);
and checked in firebug got following error
SyntaxError: syntax error
alert("in check"+mname);</p>
error pointing towards that ‘p’. But i did not write that code. i don`t know why this is appended in generated code?
Use this
use ‘;’ after
and use
In my system is working now.
i tried inline javascript plugin and it works for me. You have to just add follwing tags between your js code
Check this video tutorial:
https://www.youtube.com/watch?v=zjNVryaNz0E
Updated
Add JS like this on your any WP Page or Post It works:
FYI :it does not required any plugin for add js into WordPress page /post
I hope this helps you!!