Add an attribute for an object
This code works on the section that support the class you choose...
document.getElementById('IDATTRIBUTE').attribute = "value";
document.getElementByClass('CLASSATTRIBUTE').attribute = "value";
Here you are an example of a code edited:
Forum version: PunBB
Description: Paste a message, that will be deleted on click, in the textarea
document.getElementById('text_editor_textarea').placeholder = "Write your message in this ares";
Customize the tutorial
Edit "CLASS/IDATTRIBUTE" with the id/class of the object you want to add the attribute; change "Attribute" with the attribute-name you want to add and "value" with the value of the attribute
|The tutorial was tested on this forum and with the browser Google Chrome; If you notice that the tutorial doesn't work for a browser or for a version of forum (PhpBB2, PhpBB3, PunBB, Invision) contact an administrator and we will fill this field with your reporting.|
Thanks, the staff
|For every problem or question please, contact us in the section Support for the tutorials, The staff will answer you as soon as it is possible...|
The team of the Forum of Codes.