Note that there are some explanatory texts on larger screens.

plurals
  1. POJS Text Loop with Previous, Pause & Next Button
    primarykey
    data
    text
    <p>I have the below code with me for Text with Next &amp; Previous Button. I want this to loop repeatedly on page load and one button for pause in between the both. All three buttons to be totally on the right side on the same line of displaying the text. Please support me.. thanks... </p> <pre><code>&lt;!DOC HTML&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; var messages = [ 'Messages for &lt;em&gt;kindergarden&lt;/em&gt; class', 'Message for &lt;em&gt;1st grade&lt;/em&gt;', 'Message for &lt;em&gt;2nd grade&lt;/em&gt;', 'Message for &lt;em&gt;3rd grade&lt;/em&gt;', 'Message for &lt;em&gt;4th grade&lt;/em&gt;', 'Message for &lt;em&gt;5th grade&lt;/em&gt;', 'Message for &lt;em&gt;6th grade&lt;/em&gt;' ]; var msgPtr = 0; function nextMsg(direction) { msgPtr = msgPtr + direction; if (msgPtr &lt; 0) { msgPtr = messages.length-1; } if (msgPtr &gt; messages.length-1) { msgPtr = 0; } document.getElementById('msg').innerHTML = messages[msgPtr]; } window.onload = function () { nextMsg(0); } &lt;/script&gt; &lt;style type="text/css"&gt; em { color:orange; } #msg { font-family:monospace; background-color:yellow; font-size:1em; width:890px; border:1px dotted red; overflow:hidden;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="msg"&gt;&lt;/div&gt;&lt;br&gt; &lt;button onclick="nextMsg(-1)"&gt;&amp;lt;&lt;/button&gt; &lt;button onclick="nextMsg(-1)"&gt;||&lt;/button&gt; &lt;button onclick="nextMsg(1)"&gt;&amp;gt;&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload