How to add option element in select field.
See original GitHub issueHi Miguel,
Stupid question, how do you add option elements in the select field of the forms?
I looked and I noticed that it seems to use the same traits as the forms package from grapesjs plugin, but I still don’t get it.
I noticed that when dropping the select element it adds a default option.
<select class="form-control" id="i54ef"><option value="">- Select option -</option><option value="1">Option 1</option></select>
Like this, but when I click on the select element in the canvas, I don’t see the options appear in the options trait.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Adding options to select with javascript - html - Stack Overflow
var firstSelect = document.getElementById('first select elements id'), secondSelect = document.getElementById('second select elements id'), ...
Read more >HTML DOM Select add() Method - W3Schools
The add() method is used to add an option to a drop-down list. Tip: To remove an option from a drop-down list, use...
Read more >How to Add / Remove Options of a Selection Box Dynamically
JavaScript uses the HTMLSelectElement type to represent the <select> element. · Use the add() method of the HTMLSelectElement to add an option to...
Read more >HTMLSelectElement.add() - Web APIs | MDN
The HTMLSelectElement.add() method adds an element to the collection of option elements for this select element.
Read more >How to Add Option to Select Tag From Input Text Using ...
For adding an option from the input text in a select tag, use the “add()” method with “Option” Constructor. The add() method is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I also thought that, maybe I can try to do something about the select’s options in the traits.
Alright, so I integrated the code into the plugin, additionally you can pass the optionsStringSeparator in the config if you want to use another separator instead of the ‘::’
Default separator:
Custom separator: