By editor, 6 June, 2017 Question On Firefox and Chrome how to run JS codes using browser console ? Note : Following examples are tested on FireFox Version 52. Open Web browser console. F12 Method 1 . Press F12 and click on "Console" Method 2 . Press Ctrl + Shift + K Example 1. Test the console. Type alert('Hello'); this will open a "Hello" dialog box. Example 2. Change input value by ID. () document.getElementById("the_element_id").value Example 3. Change all inputs (checkbox) start with 'variable' to 'checked' Note : I use this example to activate features on Drupal 7 var eles = []; var inputs = document.getElementsByTagName("input"); for(var i = 0; i < inputs.length; i++) { if(inputs[i].name.indexOf('variable') == 0) { inputs[i].checked = 'checked'; } } Tags Drupal 8 Code JavaScript Features JavaScript useful tips and examples Comments You must have JavaScript enabled to use this form. Your name Subject Comment About text formats Text format Plain textBasic_html Plain text No HTML tags allowed. Lines and paragraphs break automatically. Web page addresses and email addresses turn into links automatically.
Comments