1:
<script>
$(function () {
var $butObj = $("-sharpbutObj");
$butObj.click(function () {
var $uname = $("-sharpuserName");
var inputName = $uname[0];
alert(inputName.value);
});
})
</script>
2:
<script>
var $butObj = $("-sharpbutObj");
$butObj.click(function () {
var $uname = $("-sharpuserName");
var inputName = $uname[0];
alert(inputName.value);
});
</script>
<body>
:
<input type="text" id="userName">
<input type="button" id="butObj" value="">
</body>
clickclick