如果用户选择了特定选项,但我想显示警告消息,但警告未显示.如何修改我的代码以使其正常工作?这是一个关于jsFiddle的演示,可以重现这个问题吗?
HTML:
<input type="text" id="mail_address"/>
<select>
<option value='google.com'>google.com</option>
<option onClick="warningaa()" value=''>Don't send mail</option>
</select>
Run Code Online (Sandbox Code Playgroud)
JS:
function warningaa() {
alert('If you choose this option, you can not receive any information');
}
Run Code Online (Sandbox Code Playgroud) 我不知道“函数(事件)”这句话的意思
Event.add(apple,'click',function(event) {
Event.stopPropagation(event);
});
Run Code Online (Sandbox Code Playgroud)
参数'event'不是javascript的唯一关键字吗?
关键字可以是某个函数的参数吗?
我理解以下代码的含义:
function(test) {
alert(test);
}
Run Code Online (Sandbox Code Playgroud)
但我不明白这一点:
功能(事件)...
任何人都可以向我解释一下吗?
我想让父亲和孩子之间有不同的背景。
小提琴:http : //jsfiddle.net/cbcL6osm/
我的意思是,如果您看到子div,则其背景颜色是从父div继承的红色。
那不是我想要的。
我希望让子div仅显示其背景图像,而不继承其父div的背景颜色。
以下是小提琴的代码:http : //jsfiddle.net/cbcL6osm/
html :
<div class="father">
test
<div class="child">
test
</div>
</div>
css :
.father {
width: 100px;
height: 100px;
background-color:red;
position:relative;
}
.child {
position:absolute;
top:20px;
left:20px;
width: 60px;
height: 60px;
background:url('https://www.google.co.kr/logos/doodles/2014/leo-tolstoys-186th-birthday-5756677508825088.2-res.png') center;
background-size:30px 30px;
background-repeat:no-repeat;
border:thin solid;
}
Run Code Online (Sandbox Code Playgroud)