I have 开发者_开发技巧a variable itemid (which is the id of an element) which I want to hide, but firefox tells me this code is illegal:
  $(#(itemid)).hide();
Is what I am trying not possible or am I just tring it the wrong way? Also, in terms of debugging, is it possible to use javascript variable in alert boxes?
Thanks
try this:
$('#' + itemid).hide();
Try This
  $('#'+itemid).hide();
Your code should be:
$("#"+itemid).hide();
Your selector syntax is incorrect. Try:
$("#" + itemid).hide();
EDIT
Fixed stupid mistake.
And to answer the second part of your question, yes it is.
var someVar = "hello world";
alert(someVar); // displays an alert box with the variable
this will do it :
var itemid = '';
$('#'+ itemid ).hide();
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论