soyjavi / QuoJS

Micro #JavaScript Library for Mobile Devices
MIT License
2.07k stars 236 forks source link

Select value html() #33

Closed fleandro22 closed 11 years ago

fleandro22 commented 12 years ago

I am trying to capture the value chosen is a select but I generate error

$$('#select1').on("change",function(){

        name_select= $$('#select1 option:selected').html();

});

ERROR Uncaught Error: SYNTAX_ERR: DOM Exception 12

thanks

soyjavi commented 12 years ago

try this:

$$('#select1').on("change",function(event){

    name_select= $$(this).val();

});

2012/11/1 fleandro22 notifications@github.com

I am trying to capture the value chosen is a select but I generate error

HTML OneTwoThree

QUO

$$('#select1').on("change",function(){

    name_select= $$('#select_eventos option:selected').html();

});

ERROR Uncaught Error: SYNTAX_ERR: DOM Exception 12

thanks

— Reply to this email directly or view it on GitHubhttps://github.com/soyjavi/QuoJS/issues/33.

fleandro22 commented 12 years ago

Gracias maestro,es correcto asi me funciona y trae el option value, pero necesito es el contenido. Como lo puedo hacer gracias .