function alert (data, callback) {
var alert_head = document.createElement('div')
var alert_bg = document.createElement('div')
var alert_box = document.createElement('div')
var alert_text = document.createElement('div')
var alert_btn = document.createElement('div')
var textNode = document.createTextNode(data ? data : '')
var btnText = document.createTextNode('确定')
var headText = document.createTextNode('提示信息')
'background-color': 'rega(0,0,0,0.1)',
'transform': 'translate(-50%, -50%)'
'border-bottom': '1px solid #CDCDCD'
alert_text.appendChild(textNode)
alert_btn.appendChild(btnText)
alert_head.appendChild(headText)
alert_box.appendChild(alert_head)
alert_box.appendChild(alert_text)
alert_box.appendChild(alert_btn)
alert_bg.appendChild(alert_box)
document.getElementsByTagName('body')[0].appendChild(alert_bg)
alert_btn.onclick = function () {
alert_bg.parentNode.removeChild(alert_bg)
if(typeof callbck === 'function') {
function css(targetObj, cssObj) {
var str = targetObj.getAttribute('style') ? targetObj.getAttribute('style') : ''
str += i + ':' + cssObj[i] + ';'
targetObj.style.cssText = str