Prototype: Add attribute to element
Below is syntax for add new attribute to element in prototype.
Syntax:
$('element').setAttribute('{attribute_name}', "{attribute_value}");
Here is code for add new attribute in element:
<script type="text/javascript"> $('element').setAttribute('href', "http://wwww.example.com"); </script>