I have created a shape using the raphael JS library. I have an input field on my page. I want to toggle a glow around that shape when the input field is clicked on.
Here is the code I’ve already tried:
var searchBoxHtml = document.getElementsByName("searchBox");
searchBoxHtml.onclick= function () {europe_africa.glow({width: 10,fill: false, opacity: 0.5, offsetx: 0,offsety: 0,color:'white'}); };
This is not working. I have also tried putting the event handler inside the input tag and it didn’t work.
I actually found out my mistake. I just had to add a [0] at the end of
getElementsByName("searchBox")as the value it returns is an array.