简体   繁体   中英

Why this simple code not working on JSfiddle?

http://jsfiddle.net/dolours/Yazpj/577/ I can't figure out what is the issue with this js fiddle! why alert not showing up?

<input type='input' name='name' id='name' value="test" class='required' />
<input type="button" value="test" onclick="test()"/>

function test()
{
var testvalues = $('#name').val();   
alert(testvalues);
}

You have to set jQuery in the library option since you are using jQuery in your code. jsfiddle.net/Yazpj/578/

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM