https://www.w3schools.com › jsref › met_element_setattribute.asp
HTML DOM Element setAttribute() Method - W3SchoolsThe setAttribute() method sets a new value to an attribute. If the attribute does not exist, it is created first.
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
https://developer.mozilla.org › fr › docs › Web › API › Element › setAttribute
Element : méthode setAttribute() - Les API Web | MDN - MDN Web DocsLa méthode setAttribute (), rattachée à l'interface Element, ajoute un nouvel attribut ou change la valeur d'un attribut existant en utilisant la valeur fournie. Si l'attribut existe déjà, la valeur est mise à jour ; sinon, un nouvel attribut est ajouté avec le nom et la valeur spécifiés.
https://developer.mozilla.org › en-US › docs › Web › API › Element › setAttribute
Element: setAttribute() method - Web APIs | MDN - MDN Web DocsThe setAttribute() method of the Element interface sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value.
https://www.javascripttutorial.net › javascript-dom › javascript-setattribute
JavaScript setAttribute() Method - JavaScript TutorialIn this tutorial, you will learn how to use the JavaScript setAttribute() method to set a value for an attribute on a specified element.
https://www.aliasdmc.fr › dom_javascript › javascript_element_setattribute.html
Dom CORE : Objet Element.setAttribute - Zone XHTMLLa méthode javascript setAttribute(nom,donnée) de l'objet Element permet de spécifier la valeur d'un attribut d'un élément par rapport à son nom, ou d'en créer un, s'il n'existe pas dans l'élément.
https://www.w3bai.com › fr › jsref › met_element_setattribute.html
HTML DOM setAttribute() Method - w3bai.comLe setAttribute () méthode ajoute le specified attribut à un élément, et il donne la valeur spécifiée. Si le specified attribut existe déjà, seule la valeur est définie / modifiée.
Sets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value. To get the current value of an attribute, use getAttribute(); to remove an attribute, call removeAttribute().
https://docs.w3cub.com › dom › element › setattribute
Element.setAttribute - Web APIs - W3cubDocsSets the value of an attribute on the specified element. If the attribute already exists, the value is updated; otherwise a new attribute is added with the specified name and value. To get the current value of an attribute, use getAttribute(); to remove an attribute, call removeAttribute().
https://stackoverflow.com › questions › 11286661
dom - Set custom attribute using JavaScript - Stack OverflowUse the setAttribute method: document.getElementById('item1').setAttribute('data', "icon: 'base2.gif', url: 'output.htm', target: 'AccessPage', output: '1'"); But you really should be using data followed with a dash and with its property, like:
https://www.toutjavascript.com › reference › ref-htmlelement.setattribute.php
HTMLElement.setAttribute () - Référence du JS - Tout JavaScript.comAffecte une valeur à un attribut sur l'objet HTML. Affecte sur l'objet l'attribut nomAttribut avec comme contenu valeur. La lecture d'un attribut se fait par la fonction getAttribute (). Equivalent en jQuery à $.attr () : Affecte une valeur à un attribut.