Can not set decimal value as default in dropdownlistfor asp.net core using javascript

Viewed 50

if value is not decimal then work fine but only problem with decimal value in below code

$('select#listspec_0__qty option[value = 105.3]').attr("selected", true);

2 Answers

use quotation marks for value:

$('select#listspec_0__qty option[value = "105.3"]').attr("selected", true);

Use Double Quotation "105.3"

 $('select#listspec_0__qty option[value = "105.3"]').attr("selected", true);
Related