Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们如何把agru函数放在里面$('input[name=agru]')
agru
$('input[name=agru]')
function changeBackground(agru){ $('input[name=agru]').css('background','red'); }
$('input[name=agru]')不对。我该如何逃脱?谢谢
利用
function addBorder(agru) { $('input[name=' + agru + ']').css('background', 'red'); }
阅读如何将字符串与变量连接起来?