jQuery .html()和其中的一个变量 [英] jQuery .html() and a variable inside

查看:67
本文介绍了jQuery .html()和其中的一个变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将变量FLC放入$("#FNC").html('');内,但是不知道如何提示?

I would like to put variable FLC in inside $("#FNC").html(''); but don't know how to, any tips?

演示:

var FLV = $("#random-input-box").val();
$("#FNC").html('<input id="random-input-box" style="width: 99px;" value="FLC" disabled="disabled" />');

推荐答案

您的意思是将FLV的值放入input字段的value属性中吗?

Did you mean putting the value of FLV into the value attribute of the input field?

var FLV = $("#random-input-box").val();
$("#FNC").html('<input id="random-input-box" style="width: 99px;" value="'+FLV+'" disabled="disabled" />');

这篇关于jQuery .html()和其中的一个变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆