【发布时间】:2019-05-06 15:43:26
【问题描述】:
我想在此处的下拉列表中选择值后显示我的内容我所拥有的是Personal,如果您选择内容将会改变。但我的内容是hide,所以当我在下拉列表中选择一个值时,即显示内容的时间。
我的下拉菜单
<select name="messagetype" id="messagetype" class="selectpicker" data-style="select-with-transition" title="News Type" data-size="7" onchange="fun_showtextbox()">
<option disabled="">Select Receipt</option>
<option value="All">Send to all</option>
<option value="Personal">Send to Personal</option>
</select>
我的内容div
<div id="sectiontohide" style="display:none;" id="mobileno_textbox">
<p>Show Content</p>
</div
我的 Javascrip/Jquery
<script type="text/javascript">
function fun_showtextbox(){
var select_status=$('#messagetype').val();
if(select_status == 'Personal')
{
$('#mobileno_textbox').show();
}
else
{
$('#mobileno_textbox').hide();
}
}
</script>
我的链接
<script src="{{ asset('vendor/jquery/jquery.min.js') }}"></script>
【问题讨论】:
-
你的代码有什么问题?
-
当我选择值没有变化时不显示内容,不显示内容
标签: javascript jquery html ajax laravel