小编DSM*_*DSM的帖子

如何将JavaScript添加到HTML页面?

我是网络开发的新手,我想在我的简单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)

html javascript jquery html5

2
推荐指数
1
解决办法
415
查看次数

使用run()而不是线程的start()会发生什么?

厌恶线程类工作正常.我能理解它的过程.然后我改变了

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)

java multithreading java-threads

0
推荐指数
1
解决办法
108
查看次数

标签 统计

html ×1

html5 ×1

java ×1

java-threads ×1

javascript ×1

jquery ×1

multithreading ×1