How to replace a text with a keyword?












0















Hello I'm creating a chat app and I was tryin to make textarea to accept svg files, but it only accepts the code, so I made it taking the code to the text area. The problem is that the text of the svg files(made them php) is huge. How can I cover/replace them to textarea only with a word? And this I can use it only once, how can I use it multiple times without pressing F5 everytime that I want to add an emoji? Here is the code for the chat, Thank you!



    <textarea id="comment" style="width: 280px; margin-top: 10px; box- 
shadow: inset 0 -15px 35px -5px rgba(0,0,0,0.3); height: 40px;
overflow: auto;">
</textarea>

<center><p class="emoticonsTitle">Emojis</p></center>
<div class="emojis">
<ul>
<li><a style="cursor: pointer;" onclick="test()"><img
src="emoticons/cloudda3.svg"
style="width:28px;height:28px;"/></a></li>
<li><a style="cursor: pointer;" onclick="test2()"><img
src="emoticons/cloudnigh3.svg" style="width:28px;height:28px;"/></a></li>
<li><a style="cursor: pointer;" onclick="test3()"><img
src="emoticons/cloudy.svg" style="width:28px;height:28px;"/></a></li>
<li><a style="cursor: pointer;" onclick="test4()"><img
src="emoticons/cloudy-day-1.svg" style="width:28px;height:28px;"/></a>
</li>
<li><a style="cursor: pointer;" onclick="test5()"><img
src="emoticons/cloudy-day-2.svg" style="width:28px;height:28px;" /></a>
</li>
<li><a style="cursor: pointer;" onclick="test6()"><img
src="emoticons/cloudy-night-1.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test7()"><img
src="emoticons/cloudy-night-2.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test8()"><img
src="emoticons/night.svg" style="width:28px;height:28px;"
/></a></li>
<li><a style="cursor: pointer;" onclick="test9()"><img
src="emoticons/rainy-1.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test10()"><img
src="emoticons/rainy-2.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test11()"><img
src="emoticons/rainy-3.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test12()"><img
src="emoticons/rainy-4.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test13()"><img
src="emoticons/rainy-5.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test14()"><img
src="emoticons/rainy-6.svg"
style="width:28px;height:28px;" /></a></li>
<li><a style="cursor: pointer;" onclick="test15()"><img
src="emoticons/rainy-7.svg"
style="width:28px;height:28px;" /></a></li>
</ul>



<script type="text/javascript">
function test(){
$.ajax({url:"cloudda3.php",success:function(result){
$("#comment").text(result);
}})
}

function test2(){
$.ajax({url:"cloudnigh3.php",success:function(result){
$("#comment").text(result);
}})
}

function test3(){
$.ajax({url:"cloudy.php",success:function(result){
$("#comment").text(result);
}})
}

function test4(){
$.ajax({url:"cloudy-day-1.php",success:function(result){
$("#comment").text(result);
}})
}

function test5(){
$.ajax({url:"cloudy-day-2.php",success:function(result){
$("#comment").text(result);
}})
}

function test6(){
$.ajax({url:"cloudy-night-1.php",success:function(result){
$("#comment").text(result);
}})
}

function test7(){
$.ajax({url:"cloudy-night-2.php",success:function(result){
$("#comment").text(result);
}})
}

function test8(){
$.ajax({url:"night.php",success:function(result){
$("#comment").text(result);
}})
}

function test9(){
$.ajax({url:"rainy-1.php",success:function(result){
$("#comment").text(result);
}})
}

function test10(){
$.ajax({url:"rainy-2.php",success:function(result){
$("#comment").text(result);
}})
}

function test11(){
$.ajax({url:"rainy-3.php",success:function(result){
$("#comment").text(result);
}})
}

function test12(){
$.ajax({url:"rainy-4.php",success:function(result){
$("#comment").text(result);
}})
}

function test13(){
$.ajax({url:"rainy-5.php",success:function(result){
$("#comment").text(result);
}})
}

function test14(){
$.ajax({url:"rainy-6.php",success:function(result){
$("#comment").text(result);
}})
}

function test15(){
$.ajax({url:"rainy-7.php",success:function(result){
$("#comment").text(result);
}})
}

</script>

</div><!--Emojis-->
<br>
<br>
<input type="text" style="display:none;" id="username" value="<?php
echo
$_SESSION['user']['username']; ?>">
<button id="btn" name="btn" type="submit" onclick="post();"
style="top: 30px; cursor: pointer; color: #000; font-size: 24px;
height: 40px; border:none; font-weight: bold; box-shadow: inset 0
-15px 35px -5px rgba(0,0,0,0.3);">Αποστολή
</button>

</div>
</div>









share|improve this question



























    0















    Hello I'm creating a chat app and I was tryin to make textarea to accept svg files, but it only accepts the code, so I made it taking the code to the text area. The problem is that the text of the svg files(made them php) is huge. How can I cover/replace them to textarea only with a word? And this I can use it only once, how can I use it multiple times without pressing F5 everytime that I want to add an emoji? Here is the code for the chat, Thank you!



        <textarea id="comment" style="width: 280px; margin-top: 10px; box- 
    shadow: inset 0 -15px 35px -5px rgba(0,0,0,0.3); height: 40px;
    overflow: auto;">
    </textarea>

    <center><p class="emoticonsTitle">Emojis</p></center>
    <div class="emojis">
    <ul>
    <li><a style="cursor: pointer;" onclick="test()"><img
    src="emoticons/cloudda3.svg"
    style="width:28px;height:28px;"/></a></li>
    <li><a style="cursor: pointer;" onclick="test2()"><img
    src="emoticons/cloudnigh3.svg" style="width:28px;height:28px;"/></a></li>
    <li><a style="cursor: pointer;" onclick="test3()"><img
    src="emoticons/cloudy.svg" style="width:28px;height:28px;"/></a></li>
    <li><a style="cursor: pointer;" onclick="test4()"><img
    src="emoticons/cloudy-day-1.svg" style="width:28px;height:28px;"/></a>
    </li>
    <li><a style="cursor: pointer;" onclick="test5()"><img
    src="emoticons/cloudy-day-2.svg" style="width:28px;height:28px;" /></a>
    </li>
    <li><a style="cursor: pointer;" onclick="test6()"><img
    src="emoticons/cloudy-night-1.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test7()"><img
    src="emoticons/cloudy-night-2.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test8()"><img
    src="emoticons/night.svg" style="width:28px;height:28px;"
    /></a></li>
    <li><a style="cursor: pointer;" onclick="test9()"><img
    src="emoticons/rainy-1.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test10()"><img
    src="emoticons/rainy-2.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test11()"><img
    src="emoticons/rainy-3.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test12()"><img
    src="emoticons/rainy-4.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test13()"><img
    src="emoticons/rainy-5.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test14()"><img
    src="emoticons/rainy-6.svg"
    style="width:28px;height:28px;" /></a></li>
    <li><a style="cursor: pointer;" onclick="test15()"><img
    src="emoticons/rainy-7.svg"
    style="width:28px;height:28px;" /></a></li>
    </ul>



    <script type="text/javascript">
    function test(){
    $.ajax({url:"cloudda3.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test2(){
    $.ajax({url:"cloudnigh3.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test3(){
    $.ajax({url:"cloudy.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test4(){
    $.ajax({url:"cloudy-day-1.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test5(){
    $.ajax({url:"cloudy-day-2.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test6(){
    $.ajax({url:"cloudy-night-1.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test7(){
    $.ajax({url:"cloudy-night-2.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test8(){
    $.ajax({url:"night.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test9(){
    $.ajax({url:"rainy-1.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test10(){
    $.ajax({url:"rainy-2.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test11(){
    $.ajax({url:"rainy-3.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test12(){
    $.ajax({url:"rainy-4.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test13(){
    $.ajax({url:"rainy-5.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test14(){
    $.ajax({url:"rainy-6.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    function test15(){
    $.ajax({url:"rainy-7.php",success:function(result){
    $("#comment").text(result);
    }})
    }

    </script>

    </div><!--Emojis-->
    <br>
    <br>
    <input type="text" style="display:none;" id="username" value="<?php
    echo
    $_SESSION['user']['username']; ?>">
    <button id="btn" name="btn" type="submit" onclick="post();"
    style="top: 30px; cursor: pointer; color: #000; font-size: 24px;
    height: 40px; border:none; font-weight: bold; box-shadow: inset 0
    -15px 35px -5px rgba(0,0,0,0.3);">Αποστολή
    </button>

    </div>
    </div>









    share|improve this question

























      0












      0








      0


      0






      Hello I'm creating a chat app and I was tryin to make textarea to accept svg files, but it only accepts the code, so I made it taking the code to the text area. The problem is that the text of the svg files(made them php) is huge. How can I cover/replace them to textarea only with a word? And this I can use it only once, how can I use it multiple times without pressing F5 everytime that I want to add an emoji? Here is the code for the chat, Thank you!



          <textarea id="comment" style="width: 280px; margin-top: 10px; box- 
      shadow: inset 0 -15px 35px -5px rgba(0,0,0,0.3); height: 40px;
      overflow: auto;">
      </textarea>

      <center><p class="emoticonsTitle">Emojis</p></center>
      <div class="emojis">
      <ul>
      <li><a style="cursor: pointer;" onclick="test()"><img
      src="emoticons/cloudda3.svg"
      style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test2()"><img
      src="emoticons/cloudnigh3.svg" style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test3()"><img
      src="emoticons/cloudy.svg" style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test4()"><img
      src="emoticons/cloudy-day-1.svg" style="width:28px;height:28px;"/></a>
      </li>
      <li><a style="cursor: pointer;" onclick="test5()"><img
      src="emoticons/cloudy-day-2.svg" style="width:28px;height:28px;" /></a>
      </li>
      <li><a style="cursor: pointer;" onclick="test6()"><img
      src="emoticons/cloudy-night-1.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test7()"><img
      src="emoticons/cloudy-night-2.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test8()"><img
      src="emoticons/night.svg" style="width:28px;height:28px;"
      /></a></li>
      <li><a style="cursor: pointer;" onclick="test9()"><img
      src="emoticons/rainy-1.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test10()"><img
      src="emoticons/rainy-2.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test11()"><img
      src="emoticons/rainy-3.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test12()"><img
      src="emoticons/rainy-4.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test13()"><img
      src="emoticons/rainy-5.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test14()"><img
      src="emoticons/rainy-6.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test15()"><img
      src="emoticons/rainy-7.svg"
      style="width:28px;height:28px;" /></a></li>
      </ul>



      <script type="text/javascript">
      function test(){
      $.ajax({url:"cloudda3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test2(){
      $.ajax({url:"cloudnigh3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test3(){
      $.ajax({url:"cloudy.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test4(){
      $.ajax({url:"cloudy-day-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test5(){
      $.ajax({url:"cloudy-day-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test6(){
      $.ajax({url:"cloudy-night-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test7(){
      $.ajax({url:"cloudy-night-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test8(){
      $.ajax({url:"night.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test9(){
      $.ajax({url:"rainy-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test10(){
      $.ajax({url:"rainy-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test11(){
      $.ajax({url:"rainy-3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test12(){
      $.ajax({url:"rainy-4.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test13(){
      $.ajax({url:"rainy-5.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test14(){
      $.ajax({url:"rainy-6.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test15(){
      $.ajax({url:"rainy-7.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      </script>

      </div><!--Emojis-->
      <br>
      <br>
      <input type="text" style="display:none;" id="username" value="<?php
      echo
      $_SESSION['user']['username']; ?>">
      <button id="btn" name="btn" type="submit" onclick="post();"
      style="top: 30px; cursor: pointer; color: #000; font-size: 24px;
      height: 40px; border:none; font-weight: bold; box-shadow: inset 0
      -15px 35px -5px rgba(0,0,0,0.3);">Αποστολή
      </button>

      </div>
      </div>









      share|improve this question














      Hello I'm creating a chat app and I was tryin to make textarea to accept svg files, but it only accepts the code, so I made it taking the code to the text area. The problem is that the text of the svg files(made them php) is huge. How can I cover/replace them to textarea only with a word? And this I can use it only once, how can I use it multiple times without pressing F5 everytime that I want to add an emoji? Here is the code for the chat, Thank you!



          <textarea id="comment" style="width: 280px; margin-top: 10px; box- 
      shadow: inset 0 -15px 35px -5px rgba(0,0,0,0.3); height: 40px;
      overflow: auto;">
      </textarea>

      <center><p class="emoticonsTitle">Emojis</p></center>
      <div class="emojis">
      <ul>
      <li><a style="cursor: pointer;" onclick="test()"><img
      src="emoticons/cloudda3.svg"
      style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test2()"><img
      src="emoticons/cloudnigh3.svg" style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test3()"><img
      src="emoticons/cloudy.svg" style="width:28px;height:28px;"/></a></li>
      <li><a style="cursor: pointer;" onclick="test4()"><img
      src="emoticons/cloudy-day-1.svg" style="width:28px;height:28px;"/></a>
      </li>
      <li><a style="cursor: pointer;" onclick="test5()"><img
      src="emoticons/cloudy-day-2.svg" style="width:28px;height:28px;" /></a>
      </li>
      <li><a style="cursor: pointer;" onclick="test6()"><img
      src="emoticons/cloudy-night-1.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test7()"><img
      src="emoticons/cloudy-night-2.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test8()"><img
      src="emoticons/night.svg" style="width:28px;height:28px;"
      /></a></li>
      <li><a style="cursor: pointer;" onclick="test9()"><img
      src="emoticons/rainy-1.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test10()"><img
      src="emoticons/rainy-2.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test11()"><img
      src="emoticons/rainy-3.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test12()"><img
      src="emoticons/rainy-4.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test13()"><img
      src="emoticons/rainy-5.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test14()"><img
      src="emoticons/rainy-6.svg"
      style="width:28px;height:28px;" /></a></li>
      <li><a style="cursor: pointer;" onclick="test15()"><img
      src="emoticons/rainy-7.svg"
      style="width:28px;height:28px;" /></a></li>
      </ul>



      <script type="text/javascript">
      function test(){
      $.ajax({url:"cloudda3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test2(){
      $.ajax({url:"cloudnigh3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test3(){
      $.ajax({url:"cloudy.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test4(){
      $.ajax({url:"cloudy-day-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test5(){
      $.ajax({url:"cloudy-day-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test6(){
      $.ajax({url:"cloudy-night-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test7(){
      $.ajax({url:"cloudy-night-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test8(){
      $.ajax({url:"night.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test9(){
      $.ajax({url:"rainy-1.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test10(){
      $.ajax({url:"rainy-2.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test11(){
      $.ajax({url:"rainy-3.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test12(){
      $.ajax({url:"rainy-4.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test13(){
      $.ajax({url:"rainy-5.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test14(){
      $.ajax({url:"rainy-6.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      function test15(){
      $.ajax({url:"rainy-7.php",success:function(result){
      $("#comment").text(result);
      }})
      }

      </script>

      </div><!--Emojis-->
      <br>
      <br>
      <input type="text" style="display:none;" id="username" value="<?php
      echo
      $_SESSION['user']['username']; ?>">
      <button id="btn" name="btn" type="submit" onclick="post();"
      style="top: 30px; cursor: pointer; color: #000; font-size: 24px;
      height: 40px; border:none; font-weight: bold; box-shadow: inset 0
      -15px 35px -5px rgba(0,0,0,0.3);">Αποστολή
      </button>

      </div>
      </div>






      javascript php html css






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 21 '18 at 9:13









      L-Drac WarThornL-Drac WarThorn

      194




      194
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Drac WarThorn,



          I think you should using val() instead of text() to push new value for TextArea



          <script type="text/javascript">
          function test(){
          $.ajax({url:"cloudda3.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test2(){
          $.ajax({url:"cloudnigh3.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test3(){
          $.ajax({url:"cloudy.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test4(){
          $.ajax({url:"cloudy-day-1.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test5(){
          $.ajax({url:"cloudy-day-2.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test6(){
          $.ajax({url:"cloudy-night-1.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test7(){
          $.ajax({url:"cloudy-night-2.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test8(){
          $.ajax({url:"night.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test9(){
          $.ajax({url:"rainy-1.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test10(){
          $.ajax({url:"rainy-2.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test11(){
          $.ajax({url:"rainy-3.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test12(){
          $.ajax({url:"rainy-4.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test13(){
          $.ajax({url:"rainy-5.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test14(){
          $.ajax({url:"rainy-6.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          function test15(){
          $.ajax({url:"rainy-7.php",success:function(result){
          $("#comment").val(result);
          }})
          }

          </script>





          share|improve this answer
























          • Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

            – L-Drac WarThorn
            Nov 21 '18 at 10:35



















          0














          You can use contenteditable attribute for that purpose



          There is an example

          https://codepen.io/meddjelaili/pen/KrZYRK





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408638%2fhow-to-replace-a-text-with-a-keyword%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Drac WarThorn,



            I think you should using val() instead of text() to push new value for TextArea



            <script type="text/javascript">
            function test(){
            $.ajax({url:"cloudda3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test2(){
            $.ajax({url:"cloudnigh3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test3(){
            $.ajax({url:"cloudy.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test4(){
            $.ajax({url:"cloudy-day-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test5(){
            $.ajax({url:"cloudy-day-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test6(){
            $.ajax({url:"cloudy-night-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test7(){
            $.ajax({url:"cloudy-night-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test8(){
            $.ajax({url:"night.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test9(){
            $.ajax({url:"rainy-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test10(){
            $.ajax({url:"rainy-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test11(){
            $.ajax({url:"rainy-3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test12(){
            $.ajax({url:"rainy-4.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test13(){
            $.ajax({url:"rainy-5.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test14(){
            $.ajax({url:"rainy-6.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test15(){
            $.ajax({url:"rainy-7.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            </script>





            share|improve this answer
























            • Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

              – L-Drac WarThorn
              Nov 21 '18 at 10:35
















            1














            Drac WarThorn,



            I think you should using val() instead of text() to push new value for TextArea



            <script type="text/javascript">
            function test(){
            $.ajax({url:"cloudda3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test2(){
            $.ajax({url:"cloudnigh3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test3(){
            $.ajax({url:"cloudy.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test4(){
            $.ajax({url:"cloudy-day-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test5(){
            $.ajax({url:"cloudy-day-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test6(){
            $.ajax({url:"cloudy-night-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test7(){
            $.ajax({url:"cloudy-night-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test8(){
            $.ajax({url:"night.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test9(){
            $.ajax({url:"rainy-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test10(){
            $.ajax({url:"rainy-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test11(){
            $.ajax({url:"rainy-3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test12(){
            $.ajax({url:"rainy-4.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test13(){
            $.ajax({url:"rainy-5.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test14(){
            $.ajax({url:"rainy-6.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test15(){
            $.ajax({url:"rainy-7.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            </script>





            share|improve this answer
























            • Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

              – L-Drac WarThorn
              Nov 21 '18 at 10:35














            1












            1








            1







            Drac WarThorn,



            I think you should using val() instead of text() to push new value for TextArea



            <script type="text/javascript">
            function test(){
            $.ajax({url:"cloudda3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test2(){
            $.ajax({url:"cloudnigh3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test3(){
            $.ajax({url:"cloudy.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test4(){
            $.ajax({url:"cloudy-day-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test5(){
            $.ajax({url:"cloudy-day-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test6(){
            $.ajax({url:"cloudy-night-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test7(){
            $.ajax({url:"cloudy-night-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test8(){
            $.ajax({url:"night.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test9(){
            $.ajax({url:"rainy-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test10(){
            $.ajax({url:"rainy-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test11(){
            $.ajax({url:"rainy-3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test12(){
            $.ajax({url:"rainy-4.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test13(){
            $.ajax({url:"rainy-5.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test14(){
            $.ajax({url:"rainy-6.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test15(){
            $.ajax({url:"rainy-7.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            </script>





            share|improve this answer













            Drac WarThorn,



            I think you should using val() instead of text() to push new value for TextArea



            <script type="text/javascript">
            function test(){
            $.ajax({url:"cloudda3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test2(){
            $.ajax({url:"cloudnigh3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test3(){
            $.ajax({url:"cloudy.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test4(){
            $.ajax({url:"cloudy-day-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test5(){
            $.ajax({url:"cloudy-day-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test6(){
            $.ajax({url:"cloudy-night-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test7(){
            $.ajax({url:"cloudy-night-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test8(){
            $.ajax({url:"night.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test9(){
            $.ajax({url:"rainy-1.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test10(){
            $.ajax({url:"rainy-2.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test11(){
            $.ajax({url:"rainy-3.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test12(){
            $.ajax({url:"rainy-4.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test13(){
            $.ajax({url:"rainy-5.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test14(){
            $.ajax({url:"rainy-6.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            function test15(){
            $.ajax({url:"rainy-7.php",success:function(result){
            $("#comment").val(result);
            }})
            }

            </script>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 21 '18 at 9:23









            Binh LEBinh LE

            342517




            342517













            • Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

              – L-Drac WarThorn
              Nov 21 '18 at 10:35



















            • Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

              – L-Drac WarThorn
              Nov 21 '18 at 10:35

















            Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

            – L-Drac WarThorn
            Nov 21 '18 at 10:35





            Thanks that help, but I want you know, to minimize the text or the val at the textarea, so I can put multiple emojis too, like this :) :) :). With val I can call them anytime thanks

            – L-Drac WarThorn
            Nov 21 '18 at 10:35













            0














            You can use contenteditable attribute for that purpose



            There is an example

            https://codepen.io/meddjelaili/pen/KrZYRK





            share|improve this answer




























              0














              You can use contenteditable attribute for that purpose



              There is an example

              https://codepen.io/meddjelaili/pen/KrZYRK





              share|improve this answer


























                0












                0








                0







                You can use contenteditable attribute for that purpose



                There is an example

                https://codepen.io/meddjelaili/pen/KrZYRK





                share|improve this answer













                You can use contenteditable attribute for that purpose



                There is an example

                https://codepen.io/meddjelaili/pen/KrZYRK






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '18 at 9:50









                Med DjelailiMed Djelaili

                345




                345






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53408638%2fhow-to-replace-a-text-with-a-keyword%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?