按钮更改文本

时间:2015-10-11 22:39:04

标签: button text random triggers

我有这个代码在刷新页面时更改文本,我想添加触发按钮,所以如果有人按下按钮,他将更改文本而不刷新页面,我该怎么办?

感谢

      <script language="JavaScript" type="text/javascript">
       var arMessage = new Array(
      'She is a complete waste of space',
      'I did not recognize you with your clothes on ',
      'If I never see you again, it will be too soon ',
      'He is so full of shit, even his eyes are brown',
      'You are so far up our managers ass, I can almost see your legs',
      'She is as welcome as a turd in a swimmingpool',
      'My boss is an accident waiting for a place to happen',
      'I would not piss on you, even when you were on fire');
       var ind = Math.floor(Math.random() * 8);
       document.write('<b class="r">'+arMessage[ind]+'</b>');
       </script>  

0 个答案:

没有答案