【发布时间】:2015-03-17 02:38:30
【问题描述】:
这是我的 javascript 代码:
<script>
$(function() {
$('#input').validateCreditCard(function(result) {
$('.log').html('Card type: ' + (result.card_type == null ? '-' : result.card_type.name)
+ '<br>Valid: ' + result.valid
+ '<br>Length valid: ' + result.length_valid
+ '<br>Luhn valid: ' + result.luhn_valid);
});
});
</script>
我在 html 标签中打印结果值,例如:
<h1><script>document.write(result.card_type.name())</script></h1>
<h1><script>document.write(result.valid())</script></h1>
<h1><script>document.write(result.length_valid())</script></h1>
<h1><script>document.write(result.luhn_valid())</script></h1>
bt 它没有显示价值..!!
【问题讨论】:
-
不要使用
document.write,而是使用jquery的.html()或.text() -
我想在 html 标签之间打印“result.length_valid”..!!
-
然后在html标签之间连接起来..!!
-
bt 如何连接??
-
any1 知道如何在 html 标签中打印结果值??
标签: javascript php html