after upgrading to jsdom 0.5.0 - a selectbox val using jquery seems to return null

28 views
Skip to first unread message

Toran Billups

unread,
Feb 13, 2013, 10:17:27 AM2/13/13
to js...@googlegroups.com
Prior to the upgrade I had jsdom 0.3.1 installed and the below worked as expected using jQuery 1.7.2

        $('#body').append('
                <select id="foo">
                    <option value="first">first</option>
                    <option value="last">last</option>
                </select>
        ')
        $("#foo").val("first");

        this would let me set the value so when I did $("#foo").val() it would return "first"
        
        but after the upgrade, when I go fetch the value of the selectbox

        var result = $("#foo").val();    // null

        We even tried the prop set approach mentioned in a few places (post jQuery 1.3 this is preferred)

        $('#foo').val('first').prop('selected', true);

        var result = $("#foo").val();    // null still

        Has anyone else run into this since the upgrade from 0.3.1 ?

Domenic Denicola

unread,
Feb 15, 2013, 11:29:35 PM2/15/13
to js...@googlegroups.com
Indeed, this appears broken. Bug filed:

https://github.com/tmpvar/jsdom/issues/568

Will try to fix it soon.
Reply all
Reply to author
Forward
0 new messages