Skip to content

Category: Questions

format well defined string to an object using es5

I have either of these string: var str = “Apple Banana Kiwi Orange: fruit. Tomato: vegetable” or var str = “Tomato: maybe a fruit. Apple Banana Orange: fruit. Carrots: vegetable”. I want to format it to an object of this format only using ES5. I tried a combination of using split() and…

Appending dropdown selection to url

I’m trying to append the dropdown selection to the url. This selection part Then the call sign Final the append to url sign But as the result comes &adults=object%… instead of &adults=1 or 2 or 3 or 4. Answer If you want to get the value: However, if you want to get the selected text from …