Topic: Using the OptGroup tag with Select causes the .setValue() method to throw an error.
*Expected behavior*A value must be selected in the Select field.
*Actual behavior*A script error has occurred. (t.setNode is not a function)
Resources (screenshots, code snippets etc.)
Using only the option
tag without the optgroup
tag will work correctly.
const domain = $('#domain'); const optgroup = $('<optgroup label="Default"></optgroup>'); optgroup.append('<option value="localhost">localhost</option>); domain.append(optgroup);
const domainInstance = new mdb.Select(domain[0]); domainInstance.setValue('localhost');
Kamila Pieńkowska
staff answered 9 hours ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 9.1.0
- Device: MAC Book
- Browser: Google Chrome 140.0.7339.185
- OS: MAC OS 26
- Provided sample code: No
- Provided link: No