Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

storing bullets in a variable

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a variable which I use to loop through checkboxes and on extract of each variable I want to use bullets.
eg :
  • Apple
  • Mango

  • and the code for looping is in seperate JS file. So how can I use html tags in my JS file.
     
    Ranch Hand
    Posts: 118
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Please TellTheDetails so we have a better chance to help you.
     
    michell rosvlet
    Greenhorn
    Posts: 23
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I have attached my code below. When my variable SelectedValue loops through a checked check box before attaching the value of check box I want it to put a bullet in it. So when I display the value of variable SelectedValue I want the user to see it as shown in the eg
  • Apple
  • Mango


  •  
    author
    Posts: 15385
    6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    you should avoid eval at all costs. It is BAD.

    Reference the element with the elements array:



    I also have no clue what getValue() is.

    I am not sure what you want to do with the bullets. How/Where are the bullets being displayed? That is part of your question he have no clue about.

    Eric


     
    Sheriff
    Posts: 67620
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    If you want elements to appear in a list, you need to construct a list and its child items.

    And, once again, you should avoid using veal like the plague. To fetch a reference to a variable whose name is computed, use something like: window[some-expression]
     
    michell rosvlet
    Greenhorn
    Posts: 23
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Sorry I was not able to understand constructing a list. Are you saying some like this
    <UL>
    <li>
    <li>
    <UL>


    And I will try to avoid EVAL.
     
    Bear Bibeault
    Sheriff
    Posts: 67620
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Yes. How else did you expect to be able to display the list?
     
    WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic