javascript中的innerHtml替换原始内容并添加新内容?

时间:2013-06-03 16:10:30

标签: javascript javascript-events innerhtml

大家好我使用带有计时器选项的javascript。在那里我添加了innerHtml文本。

 <?php 
   if(get_option('popup_delay_auto')=='1') { ?> function countDown(i) {
             var int = setInterval(function () {
           document.getElementById("ptechsolinside").innerHTML = "You Must Wait Until the Timer Ends " + i;
           document.getElementById("ptechsolinside").textContent;

        i-- || clearInterval(int) || jQuery('#ptechsolfb').stop().fadeOut('medium') ; 
         //if i is 0, then stop the interval
    }, 1000);
}
countDown(<?php echo get_option('popup_template_count');?>);

<?php } ?>

我将此代码用于25秒的计时器,之后显示内容。我将文本添加为​​You Must Wait Until the Timer Ends。当我使用innerHtml时,它会替换#ptechsolinside的div中的原始内容,并添加“你必须等待直到计时器结束”。我不确定我做错了什么。现在我想显示现有内容和当前内容。我怎么能做到这一点是否有可能提出任何建议。

0 个答案:

没有答案