在加载时应用选择bg颜色? [英] Apply select bg color on load?

查看:145
本文介绍了在加载时应用选择bg颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请查看以下链接以查看我的代码:

http: //codepen.io/DigitalSquid/pen/mAkuC



如何在页面加载时显示bg颜色?

解决方案

on window.load 用selectbox id调用该函数..



试试这个

  window.onload = function(){
colourFunction (的document.getElementById( 'SELECT1'));
colourFunction(document.getElementById('select2'));
};


Please look at the following link to see my code in action:
http://codepen.io/DigitalSquid/pen/mAkuC

How can I make the bg color appear on page load?

解决方案

on window.load call that function with the selectbox ids..

try this

window.onload=function(){
 colourFunction(document.getElementById('select1'));
 colourFunction(document.getElementById('select2'));
};

这篇关于在加载时应用选择bg颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆