javascript - jquery 中的变量转义

标签 javascript jquery

我有一个这样的函数...我正在尝试使用变量gotValue插入类名。我如何在 jQuery 中传递它?我已经在 if 子句中尝试过,但没有成功。

function fullData(gotValue)
{
    alert(gotValue);
    var count = gotvalue.substring(9);
    if($('.'+gotValue+'').is(':checked'))
    {
        alert('working');
    }
}

最佳答案

Javascript 变量是 case-sensitive ;所以:

gotValue != gotvalue

关于javascript - jquery 中的变量转义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3370502/

相关文章:

jquery在一行中引用多个元素

javascript - 接受文本框中的特定字符

javascript - 用jquery高亮textarea边框一段时间

javascript - 使用google脚本操作数据条件格式和数据验证

javascript - jQueryMobile 停止页面转换

jQuery移动面板打开卷轴页面到顶部,如何改变这个?

javascript - 如何取消 keyup 函数的效果

javascript - 将 async/await 与 for in 循环一起使用

javascript - Bootstrap : Modal closing while inputs not filled

javascript - 加载后生成的 dom 元素上的 .change() 函数