JQuery not working in JSFiddle when adding as new

2019-03-03 08:37发布

This is the code

HTML

<select id="selectChange" name="selectChange">
    <option value='1' >One</option>
    <option value='2' >Two</option>
    <option value='3' >Three</option>
    <option value='4' >Four</option>
</select>

JQuery

$('#selectChange').change(function(){
        alert( $(this).val());
    });

I created a JSFiddle for JQuery on select change event. This is the link to that. As you can see, it is not working.

Then I got one JSFidle working link for JQuery on select change event form SO answer.(Don't remeber where.)

Then I updated the code to the one I already wrote in the previous link. This is the updated JSFiddle link . And it is working fine. If ypu remove the /29/ from this second URL, you can see the old JSFidle link.

You can see both the code are same. But why the first one is not working? Whenever I try to create a new JSFiddle for JQuery, I'm not able to perform it and I need to check for any already existing one and update it.

1条回答
时光不老,我们不散
2楼-- · 2019-03-03 08:44

You need to select a version of jQuery in the first drop down below the heading Frameworks & Extensions.

At the moment it's set to No library (Pure JS). This means jQuery is not available to use.

查看更多
登录 后发表回答