HTML CSS JavaScript Demo: Radio Buttons -- Version 2

Pubblicato il: 14 gennaio 2022
sul canale di: Thomas Blum
75
0

In this video we take a second look at an HTML web page with a set of radio buttons (inputs of type radio). One change from the previous version is that we placed the JavaScript into a separate file that we connect to at the bottom of the HTML page with a script tag. We used addEventListener to connect code to the click events of the button and the radio buttons. We looped over the radio-button options using the forEach method connected to arrays. Instead of looping over radio buttons and asking which one was checked, we use the document.querySelector approach and looked for something in the checked state. input[name="radSize"]:checked We put that in a try-catch block in case the user had not selected a size.


In questa pagina del sito puoi guardare il video online HTML CSS JavaScript Demo: Radio Buttons -- Version 2 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Thomas Blum 14 gennaio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 75 volte e gli è piaciuto 0 spettatori. Buona visione!