Hi I'm new to JavaScript. Looking to get some pointers and some discussion going. I'm making a simple JavaScript code where if you click some text it will make it the same as the other text in both cases. Apparently I am doing something wrong or my logic is flawed. It would be cool for some help on this thank you.
example: if you clickd on hi dude it will make it say hi man instead
if you click on hi man it will make it say hi dude
<html>
<head><script type="text/javascript">
var a=document.getElementById('idone');
var b=document.getElementById('idtwo');
if (document.getElementById('idone') = true)
{
document.getElementById('idone') =b;
document.getElementById('idtwo') =false;
}
if (document.getElementById('idtwo') = true then document.getElementById('idtwo') =a
{
document.getElementById('idtwo') =b;
document.getElementById('idone') =false;
}
onclick="document.getElementById('idone')";
onclick="document.getElementById('idtwo')";
</script>
</head>
<body>
<p id="idone">hi dude</p>
<p id="idtwo">hi man</p>
</body>
</html>