0

I got this error after 2 lines of simple codes to set a SELECT value to a variable:

Use of attributes' specified attribute is deprecated. It always returns true

Code:

var strMe = $("#o_productCategory").val();
alert(strMe);

No error message occurs when I use o_productCategory.value; but somehow it doesn't works in different browsers.

Cerbrus
  • 70,800
  • 18
  • 132
  • 147
akauts
  • 153
  • 12

1 Answers1

1

Try :

$('#o_productCategory :selected').text();

Note : Only works if value and text are same...

Anujith
  • 9,370
  • 6
  • 33
  • 48