Skip Navigation LinksHome > Blog > 2008 > March > 14

March 14, 2008

HexToString and StringToHex

At the moment I am researching on how to convert a regular string to HEX and back. You may wonder why? I gues I'll explain later.EDIT:I have come up with some basic yet incomplete functions to achieve this: 

Javascript "setAttribute()"

I just found out how to modify DOM elements using: element.setAttribute(name, value); Adds a new attribute or changes the value of an existing attribute on the specified element.  name is the name of the attribute as a string. value is the desired new value of the attribute. If the specified attribute already exists, then the value of that attribute is changed to the value passed to this function. If it does not exist, then the attribute is created.

Javascript: Change the OnClick function

After battling with this for days, I finally figured out how to change the OnClick function for an a HTML anchor tag. This method is compatible with browsers as well as IE.a.onclick = new Function() {}