If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Member Deek Fracott's Avatar
    Join Date
    Sep 2012
    Clarksville, TN
    Member #
    The following code is pretty straight forward: Click the button, and it will call a datastring into my targeted div.

    <style type="text/css">
    #output {
        height: 100px;
        width: 300px;
        border: 5px dotted blue;
    <script language="JavaScript">
    function changeContent() {
    document.getElementById('output').innerHTML="<b>called data</b>";
    <input type="button" value="Call Data" onClick="changeContent()">
    <div id="output">output div</div>
    Direct and effective. Now, what If I wanted two different buttons to call up two different datasets, id imagine it'd look something like this:

    <script language="JavaScript">
    var alpha = function changeContent() {
    document.getElementById('output').innerHTML="Data Set: A";
    var bravo = function changeContent() {
    document.getElementById('output').innerHTML="Data Set: B";
    is that correct?
    If so, how would I tweak the input button?

    <input type="button" value="Call Data Alpha" onClick="???">
    <input type="button" value="Call Data Bravo" onClick="???">
    <div id="output">output div</div>
    Thanks in advance!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 08:39 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: