user11632127
user11632127

Reputation:

How to obtain value of select box in javascript?

Im trying to obtain a value from a selectbox but I cant ,

Inspector shows me:

https://i.sstatic.net/16MZx.png

I tried 2 ways (code below), but I dont know how to get final value

In this case; "Activo"

        //way1
        var way1 = document.getElementById("Patrimonio");
        console.log(way1);
        //way2
        var way2 = document.getElementsByClassName("dx-placeholder");
        console.log(way2);

I expect obtain that value, to store in a javascript variable.

Upvotes: 0

Views: 1557

Answers (1)

Idriss Benbassou
Idriss Benbassou

Reputation: 1596

$("#Patrimonio").dxSelectBox('instance').option('value')

Upvotes: 1

Related Questions