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