This is strange. My .val() and .html() is always undefined although i am using it after everything is loaded on page. also, .text() is empty.
<div class="row col-md-12">
<div class="row col-md-12">
<label id="lblDir" style="width:auto">Scripts Directory Path: <input type="text" id="txturl"></label>
</div>
<div class="row col-md-12">
<div id="grid" style="border:dashed"></div>
</div>
<div class="row col-md-12">
<input id="btnRun" type="button" value="Run Scripts" style="margin:5px" />
</div>
<div class="row col-md-12">
<label id="result"></label>
</div>
</div>
<script>
$(function () {
$("#btnRun").kendoButton();
$("#btnRun").on("click", function (e) {
alert($('#txtUrl').text());
});
});
Things i have tried 1. putting script tag before div tag 2. adding onclick function in button html
<input id="btnRun" type="button" value="Run Scripts" onclick="onInstall();" style="margin:5px" />
Result is the same