search

Home  >  Q&A  >  body text

javascript - js cannot retrieve objects like this

Can’t js get objects like this?

string 是变量

是用绑定事件传的值

onmouseout="shubiao_onmouseover('id-del-0')"

function shubiao_onmouseover( string ){
    $("#"+string).find('.info-del').removeAttr('style');
    $("#"+string).find('.info-del').css("display","block");
}
某草草某草草2728 days ago744

reply all(5)I'll reply

  • phpcn_u1582

    phpcn_u15822017-06-12 09:32:52

    This is a reserved keyword and cannot be used as a variable

    reply
    0
  • 学习ing

    学习ing2017-06-12 09:32:52

    Yes
    <script async src="//jsfiddle.net/Laecous3/1/embed/"></script>

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-06-12 09:32:52

    You still shouldn’t be too wild when writing code. Some people say that it’s okay to look at a programmer’s level and see if his code is indented and the naming is standardized. It’s not unreasonable. It is recommended to look at the source code of open source code and look at other people's naming conventions. In short, the basics cannot be overemphasized.

    For example, in this example, wouldn’t it be appropriate to directly pass in the selector?

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-12 09:32:52

    Naming convention is very important

    Variable names are case-sensitive and are allowed to contain letters, numbers, dollar signs ($), and underscores, but the first character is not allowed to be numbers, and spaces and other punctuation marks are not allowed.
    The variable name length should be as short as possible, and Seize the key points and try to reflect the value type in the variable name
    Try to avoid using meaningless naming
    It is forbidden to use JavaScript keywords and reserved word full names
    Common variable name naming methods include camel case naming and Pascal naming

    reply
    0
  • 三叔

    三叔2017-06-12 09:32:52

    I just want to say what is this

    reply
    0
  • Cancelreply