How can I specify which divs to display using js/css

I'm building a web app that will be converted to a smartphone app, probably using phone gap build. I began by using the jquery mobile sample which appears to work well. The app will display a series of phrases on the page in English and then optionally display the phrase in Formal Spanish or Informal Spanish, the user can also tap the screen to hear the phrase.
The problem I'm having is how to control whether the user sees the Formal or informal Spanish. I'd like to have either a couple of checkboxes where the user can select Formal/ Informal/ Both or three buttons identified as Formal/ Informal/Both, buttons would be preferable to checkboxes.
I set up DIVs around the Formal and Informal Spanish phrases and defined them as "Class: Formal" or Class Informalt" and thought I'd use Display:Inline or Display:None but how do I get from someone tapping on a button to changing the CSS so that the class selected is defined as Display:Inline and the class not selected is defined as Display:None? As this will be a smartphone app all I can use is HTML, CSS and JS.
This is my first app and I'm having a hard time getting my head around this.
The web app can be seen here www.pslt.biz/mobileApp/LE4/index.html#ageWtHt  where you'll see a single English phrase and the Formal and Informal Spanish.
Thanks for any direction you can give.
Here's the html for the aprt of the page in question
<div data-role="content">
     <div style="float:left"; "width:100%">
          <div style="width:200px">
               <strong> How old are you?</strong>
          </div>
         <div  class="formal">
             <div style="float:left">
                   <a href="#" onclick="playSound('Sounds/testaycaramba.mp3');">
                   <img src="images/audio-75.gif" alt="" width="25" height="25" /></a>
             </div>
          <div style="float:left">
                Cuántos años tiene?
          </div>
       </div>
       <div class="informal">
           <div style="clear:left">
               <div  style="float:left">
                     <a href="#" onclick="playSound('Sounds/testaycaramba.mp3');">
                      <img src="images/audio-75.gif" alt="" width="25" height="25" /></a>
               </div>
               <div>
                    Cuántos años tienes?
               </div>
          </div>
   </div>
</div>

Hi Murray,
Thanks for the js code. I tried it and am having problems getting it to work. You can see the webapp here www.pslt.biz/mobileApp/LE4/index3.html , Then click on "Age, Weight & Height" and you'll see the buttons I added. There will be multiple English phrases on a page each one having two Spanish translations, one in Formal Spanish and the second in Informal Spanish. When the user clicks "Formal" they should see all the English phrases and only the Formal Spanish phrases(the first Spanish phrase after the English), when they click "Informal" they should see all the English phrases and only the Informal Spanish phrases(the second Spanish phrase) and when they click "Formal & Informal" they should see the English phrases followed by both Spanish phrases.  I have only set this up for the first phrase on the page, once i get it working for one phrase the rest should be easy....
I tried aligning the buttons underneath the page header but when I did this, using a Div around the buttons, the buttons disappeared and I was left with links in blue that were very hard to read. I must be doing something wrong here too. I really appreciate your assistance with this.
In case it helps, below is the code for the buttons in the header section of the page and the first English phrase on the page in the "Content" section of the page. Following that is the CSS which is in a separate file if that makes any difference.
Thanks again.
<div data-role="page" id="ageWtHt">
<div data-role="header" data-theme="b">
        <h1>Age, Weight & Height</h1>
        <h1>1 kilo = 2.2 lbs, 1 meter = 3.3 ft. </h1>  
    <a href="#" onclick="document.getElementById('formal').style.display='block';documen t.getElementById('informal').style.display='none';">Display Formal</a>
           <a href="#" onclick="document.getElementById('formal').style.display='none';documen t.getElementById('informal').style.display='block';">Display Informal</a>
           <a href="#" onclick="document.getElementById('formal').style.display='block';documen t.getElementById('informal').style.display='block';">Display Formal & Informal</a>
</div>
<div data-role="content">
    <!-- Start test formal informal layout -->
<div style="float:left"; "width:100%"> <!--Start formal/informal -->
     <div class="english" style="width:200px"> <!-- Start English -->
         How old are you?
     </div> <!-- End English -->
     <div class="formal"> <!-- Start Formal -->
         <div style="float:left">
            <a href="#" onclick="playSound('Sounds/testaycaramba.mp3');">
  <img src="images/audio-75.gif" alt="" width="25" height="25" /></a>
         </div>
         <div style="float:left">
          Cuántos años tiene?
         </div>
    </div> <!-- End Formal -->
    <div class="informal"> <!-- Start informal -->
         <div style="clear:left">
              <div  style="float:left">
        <a href="#" onclick="playSound('Sounds/testaycaramba.mp3');">
  <img src="images/audio-75.gif" alt="" width="25" height="25" /></a>
           </div>
           <div>
           Cuántos años tienes?
           </div>
       </div>
    </div> <!-- End informal -->
</div> <!-- End formal/informal test -->
   <!-- End test formal informal layout -->
  <h1><Br /><Br /> <Br />IGNORE BELOW HERE </h1>
*******here is the CSS*******
@charset "utf-8";
body {
font-family: Arial, Helvetica, sans-serif;
.english { display:block;
font-weight:bold;
.formal { display:block;
.informal {display:block;
Tony

Similar Messages

  • How can i know which index will be used when executing the query ?

    1 ) I have query in which i have 3-4 tables but there multiple index on one column .
    so how can i know which index will be used when executing the query ?
    2) I have a query which ia taking too much time . how can i know which table is taking too much time ?
    3) Please Provide me some document of EXplain plan ?

    Hi Jimmy,
    Consider the below example
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    CREATE TABLE FIRST AS
    SELECT * FROM all_objects;
    UPDATE FIRST
    SET object_name = 'TEST'
    WHERE owner != 'SCOTT';
    CREATE INDEX idx_first ON FIRST(object_name);
    SELECT *
    FROM FIRST
    WHERE object_name = 'TEST';
    It has not used index
    Execution Plan
    Plan hash value: 2265626682
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 58678 | 7334K| 163 (4)| 00:00:02 |
    |* 1 | TABLE ACCESS FULL| FIRST | 58678 | 7334K| 163 (4)| 00:00:02 |
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    SELECT *
    FROM FIRST
    WHERE object_name = 'emp';
    This has used the index
    Execution Plan
    Plan hash value: 1184810458
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 128 | 1 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| FIRST | 1 | 128 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | IDX_FIRST | 1 | | 1 (0)| 00:00:01 |
    From this we can come to the conclusion that, whether to use one index or not by oracle
    would also depend on the data which is present in the table. This has to be this way as
    we see in the bind peeking, if oracle sticks to only one plan, say only use the full table
    scan, it would be a performance hit when it searches for the second query ie where object_name
    ='emp';
    2.
    If we have a query like below.
    select * from emp
    where upper(ename) = upper(:p_ename);
    Evenif we have the index on ename column, oracle wouldn't be able to use the index, as there is a function in the predicate column. If you need oracle to use the index, we need to create a function based index as below.
    Create index idx_ename on emp(upper(ename));
    Regards,
    Cool

  • How can i see which Apple ID was used to download an app?

    how can i see which Apple ID was used to download an app, cause i cant remember, thanx

    Hi maikeru1,
    If you have your apps synced to iTunes, you can use a similar process to that outlined in the following article (the Get Info command) to show what Apple ID it was purchased under:
    Apple Support: Recovering a forgotten iTunes Store account name
    http://support.apple.com/kb/ht1920
    Regards,
    - Brenden

  • How do you specify which email address to use in a group list?

    Hi All,
    I've got several group lists created in Address Book. When I want to send an email to a group using Mail I cannot specify which email address gets used for a person that has multiple addresses in Address Book.
    My process is as follows: create a new blank message, address the note to myself, move to the bcc field, click the "Address" button at the top of the message pane. When I click on a name that has multiple email addresses I can click on the one that I want, but when I click to another name and click back the previously selected address is highlighted again. It seems that the selection of the address won't 'stick'. Is there any way to force the selection? Also, I originally thought that the group list defaulted to the home address, but I noticed that some entries have their work address selected by default.
    Thanks for any help.
    -Chris

    Thank you, thank you, thank you!!! I knew there was an option to do that somewhere. For some reason I had it in my mind that you made those selections in Mail.
    Kappy wrote:
    Open Address Book and select a group. CTRL- or RIGHT-click on the group and select Edit Distribution List. You may then scan through the group members selecting the desired email address for each one with multiple addresses.

  • How can I filter which records are displayed in my dynamic table?

    I have what I think is probably an easy question for anyone
    who is experienced with PHP/MySQL and Dreamweaver (which I am not).
    I have a website where users login, and then have access to
    their homepage which displays a dynamic table of all of the records
    that they have inserted into a database (this page also has a link
    to the form where they submit a record). However, right now I can
    only get to display all records that have been inserted instead of
    only the ones that they have inserted (which is what I want). How
    can I accomplish this?
    I already have a session variable, 'MM_username', which
    allows me to bind the user_ID to anything I need to, and when a
    user inserts a record, their 'user_ID' is already inserted into a
    column in that record for that table, so I'd like to display the
    dynamic table in a way that filters it out so it only shows the
    records that match the logged-in user's 'user_ID'.
    I've tried to use the filter function in the recordset dialog
    box, nut I just can't get it to work correctly. Any help on this
    would be much appreciated!

    I already tried that. I set the table to filter out and
    display only the records that match the landlord ID to the session
    variable(which I named 'Landlord_ID' not 'MM_username ' like I said
    earlier). When I tried to simply insert the session variable into
    the page just to see what data would show up, the result is just a
    blank space, so the session variable itself apparently has no data
    value to echo in the PHP form.
    Because of that, I have no idea how to tell dreamweaver to
    filter based on the Landlord_ID, even though I CAN echo the
    landlord ID variable in the recordset, I can't figure out how to
    put that runtime value in the filter.

  • How can I select which page to display based upon a log-in?

    I have created a page where the user will enter one of several codes.  I wanted to use the login function and validate the code against a table that I have pre-loaded with these codes.  The code entered would control which page was displayed to the user. 
    (I have identified a community of potential clients, and this group is broken down into 10 unique sub-groups.  Each person receives a mail that includes one of 10 unique 'codes', which identify the sub-group.  When the recipient calls up my website and enters the code (as a user ID), this will determine which of the 10 pages is displayed.  If someone randomly enters (or mis-keys) a value into the promo field a default error page (page #11) would display.)
    Is this possible using the log-in function.  Now that I'm looking at the function, it appears that any successful log-in will be directed to the same page.  If I can't use the log-in function, how can I accomplish this.  In essence, I am looking for the successful codes to act as an "if . . .then . . .else . . " type of logic.  Or, a successful hit on one of records in my table is akin to making a menu selection (that is not available in any other fashion). 
    Any help on this would be greatly appreciated. 
    BTW - kudos to David Powers and Charles Nadeau for the great tutorial on Setting up a PHP development environment for Dreamweaver!

    Thanks so much for the reply. I chose to go with the array and added the following code (my code is in red) :
       if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; 
    $redirects = array('snj830' => 'promosnj830.php', 'snj141' => 'promosnj141.php', ‘snj416’ => ‘promosnj416’);
        header("Location: " . $redirects[$_SESSION[‘MM_Username]] );
      else {
        header("Location: ". $MM_redirectLoginFailed ); 
    The re-direct on a failed logon is working successfully, but if I enter one of my 3 valid codes, the following screen is displayed:
    Index of /boundsauctions.com/promopages
    Name Last modified Size Description
         Parent Directory             -       
         _notes/      15-Oct-2010 17:40      -       
         errorpage.php      13-Oct-2010 17:24      1.9K       
         promo _login.php      15-Oct-2010 17:40      5.6K       
         promosnj141.php      15-Oct-2010 16:00      6.2K       
         promosnj416.php      15-Oct-2010 15:54      4.6K       
         promosnj830.php      15-Oct-2010 15:55      4.6K       
    As you can see, the last three pages here are the ones that I am trying to display.  Can you tell what I'm doing wrong?

  • How can I specify which contacts group is my preferred/default for my iPhone?

    Similar situation as others I've seen...
    My wife and I share an iTunes account.  We also use that account for our iCloud account.  We want to share our calendar(s) with each other.  We enjoy having access to the number of contact groups we've put together over the years. 
    I want to be able to designate one of the contact groups as my default reference for my iPhone so that when I recieve messages and calls they are recognized by the identifiers in my phone's contacts list (not as if they are my wife's contacts).  Sure, we could set up multiple iCloud accounts...  We feel we shouldn't have to, besides, that wouldn't allow us to share our calenders and contacts anymore.  It seems to my that the most "Apple" way of fixing this would be to have a "Settings" option in the "Mail, Contacts, Calendars" - particularly in the "Contacts" grouping to have a "Primary Contacts Group" (if more than one is detected) option to choose from.
    Is this something that can be done or do I need to submit this as a requested future feature to something like the Apple Bug Reporter?
    Thanks all!

    Is there a way to specify which network card (IP
    address) that the jvm will use as default? (Whenever
    opening a connection such as URL.openConnection,
    sockets without specifying the local address etc.)No there isn't, but if you are only talking about outbound connections and the network cards are on distinct subnets, unicast routing will ensure that the most appropriate outbound NIC is used for the target IP address, so configure your firewall accordingly.

  • How can I tell which clips are currently used in a sequence

    In the Project window there is a list of clips I have loaded, but often I lose track of which clips are currently used in the sequence.  In Premiere Elements there was a green check next to clips you have used in the timeline, but I don't see any indication of which clips are currently used in the sequence/timeline I am editing.
    Is there some way to sort the loaded clips so that the ones in use all appear first followed by those clips not currently being used in the timeline/sequence.  Is there some indication I am missing showing me whether or not a clip I have loaded is currently being used or not?
    -Roger Uzun

    This isn't really a sorting mechanism, but you can see how many times a clip is used, where it's used, and then navigate to it using the following non-descript button:
    You need to have a clip selected in the Project Panel to see this information, of course. Once you click the disclosure triangle, you'll see the list of sequences and the times where the clip is used; if you select one of those references, the sequence will come to the front in the Timeline panel, and the CTI will park at its in point.
    Again, not a sorting means, but it might be helpful in some instances.

  • How can I know, which RFC connection is used by my query designer ?

    HI,
    I would like to know,
    which RFC connection is used when i launch the query designer or the report designer or the web designer.
    Thanks.
    Guillaume

    Hi,
    Go to TCODE SM59 and see.
    Regards
    Nilesh

  • How can I determine which programs/files are using disc space?

    A question for the professionals:
    What program on my MacBook Pro can I run to determine which programs and files are taking up the percentage of disc space?  I am running at 72 gb, which is great, but I need to know what is using up the rest of it.  Thank you in advance to any helpful solutions.
    Matthew

    activity monitor for RAM (its already in your utilities folder) http://support.apple.com/kb/HT1342.  OmniDiscSweeper for hard drive http://www.omnigroup.com/products/omnidisksweeper/  (needs to be downloaded)

  • Lost by new interface - how can i tell which library I am using?

    I have iTunes 12 and am completely lost.
    I am on windows 7
    Yesterday  - I tried to drag an audiobook to my phone and was told that I can only sync to one library at a time. I was total confused by this because I had never changed the library. I went ahead and did it - since I don't generally use itunes content.
    Anyway - in the old iTunes I could ***** my library - this one seems to only have one library. I am totally lost - but I figure now is good time too consolidate all of my library data - delete all the old data from migrating machines and just improve iTunes Hygiene.
    BUT - I haven't go a clue of where to start.

    Did iTunes rescan your media folder after the upgrade as if it had just been installed? See Empty/corrupt iTunes library after upgrade/crash. Though if you've started on a fresh library and updated your device there is probably no benefit in switching back.
    tt2

  • HT1338 how can i find which files that are using the most storage?

    help please !!! because my storage availability is getting lower !

    Try a program such as Disk Inventory X or OmniDiskSweeper.
    (70433)

  • How can i choose which email client safari uses to email web pages?

    Right now it tries to use gmail (google chrome symbol).  When i click on the arrow, next to the address bar, the google chrome symbol appears next to the option email this page.  If selected, it then opens google chrome on the gmail sign in website.

    Nevermind I found out that my email reader was changed to google chrome, within my mail preferences. 

  • How can i specify username/password while creating a virtual directory

    Hi,
    i m trying to create a virtual directory in 9iAS on a mapped drive. How can i specify which username password to use to enable to connect to the network mapped drive. Is there any way where we can specify username / password ???
    thanks
    Unmesh

    9iAS R1
    Run the report service as a local account with administrator rights.
    On the target server, create a local account with the same user name and password.
    Now you can use the hidden shares ($) for example:
    &destype=file&desname=\\servername\d$\report_output\report.pdf
    9iAS R2 and 10g
    Pretty much the same thing except by default, the report server runs inline. I have not been able to get the entire service to run as a particular user. To get around this, I created a report server service and do not run the reports in process. It uses the separate service.
    rwserver -install rep90_name
    edit <ORACLE_HOME>\reports\conf\rwservlet.properties file.
    SERVER_IN_PROCESS=NO
    SERVER=rep90_name
    Edit service for rep90_name and change it to run as local administrator user you created on both servers and then start the service.

  • How can I tell which display hardware is installed on my powerbook G4 using the serial number?

    I have an old Powerbook G4 with no OS on it, and would like to install Linux.  Using the serial number, how can I find which display hardware is installed?

    Do you mean how to find the manufacture of the LCD display itself, or the video hardware config on the logic board?
    Finding the code for the vendor who made the display requires an OS because it is accessed through the Terminal app.
    If your serial number starts with "W8" and you are having lines show up, that is a known problem associated with the plant in Shanghai China. It also affected a large number of G5 iMacs. Only a new display will fix it and that probably costs more that any used G4 Powerbook is worth on the used market.

Maybe you are looking for