Syafrizal Natawiria
Syafrizal Natawiria

Reputation: 3

Select dropdown (option, select) css javascript

I'm currently trying to make a select dropdown (option, select) with a design like the following picture

enter image description here

When selected > 10 then the select dropdown option appears input text to fill in the desired amount.

Has anyone ever made something like this.

Thank you.

Upvotes: 0

Views: 330

Answers (2)

traktor
traktor

Reputation: 19356

The kind of drop down list requested can not be constructed simply using a combination of HTML select and option elements. This is because the only permitted content type of Option elements is text, although HTML character entities may be used. (If you need to expand character references when setting an option element's content, use its innerHTML property instead of texContent.)

I would suggest searching for an already available HTML/JavaScript/CSS widget fulfilling a similar purpose, whether it be a self contained package or library plugin, before starting to write your own code from scratch.

Upvotes: 0

Steve Walson
Steve Walson

Reputation: 470

I think you'll just add an if statement for > 10 then the input display will change from none to whatever you want.

Upvotes: 0

Related Questions