在线html转字符串, 脱html标签
在线脱去html标签,将html页面转化为字符串,只留下文字
https://blog.nice100.net/html2text.html
在线脱去html标签,将html页面转化为字符串,只留下文字
https://blog.nice100.net/html2text.html
单选框(radio)
禁止单选框选择,同时表单提交时该值能一起提交
//这个技巧就是将除选中的那个单选框之外的都设置为disabled,这样就无法切换到其他的单选框, 同时选中的radio没有被disabled所以表单提交时,该值也能提交
//js脚本如下
<script>
$(':radio:not(:checked)').attr('disabled', true);
</script>
多选框(checkbox)
selectedArray = $.map($('input[name="locationthemes"]:checked'), function(c){return c.value; })
下拉选择框(select)
怎么禁止下拉框选择,不使用disabled,因为disable不能表单提交?
<style>
select[readonly] {
background: #eee;
cursor: no-drop;
}
select[readonly] option {
display: none;
}
</style>
然后在你要禁用的select标签上加上readonly属性
select下选择框移除底下所有option选项,但保留第一个option选项?
$('#selectId option:not(:first)').remove();//假设你的select下拉框id为selectId
如下代码,结果的精度会不正确.
echo json_encode(0.6);//结果0.59999999999999998
出现这种情况,是因为json_encode行为受到了php.ini中serialize_precision配置的影响,看网上是说将这个值调成小等于16会正常.其实将其设成-1是个更好的选择,-1表示php根据精度自动调整. 所以解决方案就是要么直接改php.ini中的serialize_precision; 或者你没权限或不想更改这个配置, 那么使用如下代码:
ini_set('serialize_precision', -1);
echo json_decode(0.6);//结果0.6, 正常