Javascript 需要将.css添加到类中

Javascript 需要将.css添加到类中,javascript,jquery,css,Javascript,Jquery,Css,我需要向类添加一些css。这就是我到目前为止所做的: $(document).ready(function() { $('.tech').css({ "border-bottom": "dotted 1px #0860a8", "text-decoration": "none" }); $('.tech').Tooltip(onMouseEnter) }); 它不起作用。我可以做什么来显示所有class=“tech”请尝试以下操作: $('.tech').css({ "bor

我需要向类添加一些css。这就是我到目前为止所做的:

$(document).ready(function() {
    $('.tech').css({ "border-bottom": "dotted 1px #0860a8", "text-decoration": "none" });
    $('.tech').Tooltip(onMouseEnter) 
});
它不起作用。我可以做什么来显示所有class=“tech”

请尝试以下操作:

$('.tech').css({ "border-bottom": "dotted 1px #0860a8", "text-decoration": "none" });
(注意tech之前的时间段)

尝试以下操作:

$('.tech').css({ "border-bottom": "dotted 1px #0860a8", "text-decoration": "none" });

(注意tech之前的时间段)

您缺少一个点

$('.tech').css({ 
         "border-bottom": "dotted 1px #0860a8", 
         "text-decoration": "none" 
});

要选择类,请使用.classname;要选择id,请分别使用#id。

您缺少一个点

$('.tech').css({ 
         "border-bottom": "dotted 1px #0860a8", 
         "text-decoration": "none" 
});
要选择类,请分别使用.classname和#id