var text = document getElementById('text'); text disabled = true; On peut utiliser checked pour des boutons radio :
18 mar 2013 · To access an HTML element from JavaScript, you can use the document getElementById(id) method Use the "id" attribute to identify the HTML
25 mar 2020 · TypeError: "document getElementById( ) is null" http://127 0 0 1/condorinformatique/formgen/f html:34 The ID doesn't exists
The HTML DOM Document Object Method Description document getElementById(id) Find an element by element id document getElementsByTagName(name)
JavaScript function ToggleDisplay(elemId) { var elem = document getElementById(elemId); elem style display = (elem style display = 'none') ? 'none' : ''; }
wouldn't it be more sensible to check it here? 310 */ 311 innerDiv = document getElementById("innerDiv"); 312 //need to get an absolute function here
getElementById() getElementsByClassName() e g find the href attribute of a link element in the DOM let link = document body getElementsByTagName("a")[0];