我有以下视图页
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="sample"></div>
_Layout Page
<div class="button" type="button"></button>
<script type="text/javascript">
$(document).ready(function () {
$(".button").click(function () {
alert($("#sample").val());
});
}
</script>
如何在_LayoutPage中单击按钮时获取样本值,上方警告未显示值