how to add image based on if condition in JavaScript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 123123om
    New Member
    • Apr 2012
    • 14

    #16
    i replaced it with desc
    Code:
    document.getElementByID("desc").innerHTML = '<img src="images/cloudy.gif" alt="">';
    that i am having in
    Code:
    <input id="desc" name="desc"  type="text" class="text required"  disabled="disabled"/>
    id is in "input" tag

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #17
      did you remember to call it at the right time?

      getElementById( ) not getElementByID( ). JS is case-sensitive.

      Comment

      • 123123om
        New Member
        • Apr 2012
        • 14

        #18
        oh sorry, used this only getElementById( ), only image is not getting displaying i think i am not calling it @ right time, there are no errors also

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #19
          did you check the error console?

          Comment

          • 123123om
            New Member
            • Apr 2012
            • 14

            #20
            yes, no errors. is there any other way to copy the page ? i wanted to copy my webpage.

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #21
              if you don’t get any errors, the code must work (because only an error can prevent the code from working).

              copy the page to where? a public server to access it would be the best for me.

              Comment

              • 123123om
                New Member
                • Apr 2012
                • 14

                #22
                yes the webpage is free of errors but not getting the required image in specific location based on the if condition.

                i wanted to show you my ui page, here there is no option to copy the page

                Comment

                Working...