0

I got this weird problem: I get content that is dynamically built. In this special case I also get the element "input" as content, which is then displayed directly by the browser as an element.

What I get:

<div class="search_result_content"> this is just text, but the code <input variable="" name=""> displays as an element

enter image description here

What i need:

enter image description here

2 Answers2

0

You may want to add 'type="text"', so total would be like

<input type="text" name="" value=""/>

Else if the input needs to be added to a (like) 'span' or 'div', i would suggest JS or jQuery

Jaapaap
  • 221
  • 1
  • 5
0

$(document).ready(function() {
  $(".search_result_content").append('<input variable="" name="">');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="search_result_content"> this is just text, but the code  </div>

u insert the input tag dynamically in this scenario, after inserting convert it into html format

karthick s
  • 54
  • 1
  • 7