我是网络开发的新手,我想在我的简单html页面中添加以下功能,但是如果我按下"click me"就不会发生任何事情.描述部分不隐藏和显示
我添加了以下代码.CSS工作得很好.但JavaScript不起作用.我该如何解决这个问题
<html>
<head>
<title>TEST</title>
<link rel="stylesheet" type="text/css" href="hpcss.css">
<script>
// Hide all the elements in the DOM that have a class of "box"
$('.box').hide();
// Make sure all the elements with a class of "clickme" are visible and bound
// with a click event to toggle the "box" state
$('.clickme').each(function() {
$(this).show(0).on('click', function(e) {
// This is only needed if your using an anchor to target the "box" elements
e.preventDefault();
// Find the next "box" element in …Run Code Online (Sandbox Code Playgroud) 厌恶线程类工作正常.我能理解它的过程.然后我改变了
mc.srart()进入mc.run()但没有任何改变,也没有任何错误.
有人可以向我解释一下吗?我们总是可以使用run()而不是start()吗?
public class Main {
public static void main(String[] args) {
Myclass mc = new Myclass();
mc.start();
}
}
class Myclass extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.print(i + "--");
}
}
}
Run Code Online (Sandbox Code Playgroud)