Bhavik Modh
Bhavik Modh

Reputation: 43

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

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);

Upvotes: 2

Views: 66

Answers (2)

Rk Developer
Rk Developer

Reputation: 88

Use Double Quotation "105.3"

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

Upvotes: 1

ALexander Lead
ALexander Lead

Reputation: 143

use quotation marks for value:

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

Upvotes: 1

Related Questions