Results 1 to 19 of 19

Thread: [RESOLVED] How to make links in div".conDiv" clickable because they are now not?

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2018
    Posts
    125

    Resolved [RESOLVED] How to make links in div".conDiv" clickable because they are now not?

    Hi all,
    I have a div ".conDiv"
    used to display messages sent to it by user in a simple chat app
    HTML Code:
     .conDiv {
            color: blue;
            background-color: lightgrey;
            border-color:red;
            overflow: auto;
            text-align: left;
            box-shadow: 10px 10px 8px #888888;
            margin: auto;
            border: 3px solid red;
            padding: 5px;
            width: 300px;
            height: 270px;
            word-wrap: break-word ;
        }
    <body>
    <div class="conDiv"  id="conDivID"></div>
              <br>
              <div class=" myInputtextDiv">
                <input style="color:black;" type="text" id="myInput" maxlength="10000">
                <input type="text" id="baseimage"  hidden  >
                </br>
    <input id="myBtn" type="button" onclick="sendFunction()" value=" Send">
    
    
    <script>
           function sendFunction() {
               var userName = document.getElementById("myUserName").value;
               var userinput = document.getElementById("myInput").value;
               var imagesrc = document.getElementById("baseimage");
     var img = $('<img width=" =100px;" height=" 100px">').attr('src', imagesrc.value);
            
        $('#conDivID').append("<span style='color: red'>" + userName + ': </span>');
        $('#conDivID').append("<span style='color: blue'>" + userinput + ' </span>');
        $('#conDivID').append('</br>');
        $('#conDivID').append("<span class='timeSpan'>" + timestring + '</span>');
                   $('#conDivID').append('</br>');
                   $('#conDivID').append(img);
                   $('#conDivID').append('</br>');
                   
    
                  
               }
              
    </script>
    And I can't figure it out why when I send links to div it is not clickable
    So any help?
    How to make links in div".conDiv" clickable because they are now not?

    Thank you for your time very much. Any help will be appreciated.
    Last edited by Max45; Nov 26th, 2018 at 06:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width