Write a program that renders JSX elements. The input will contain a string representing the JSX element. The output should be the rendered HTML string. For example, if the input is <div>Hello World</div>, the output should be <div>Hello World</div>.
Example 1
Input: <div>Hello World</div>
Output: <div>Hello World</div>
A simple element with text content renders exactly as written.
Example 2
Input: <p>This is a paragraph</p>
Output: <p>This is a paragraph</p>
The tag and its text are preserved in the output.
Example 3
Input: <img src="image.jpg" />
Output: <img src="image.jpg" />
A self-closing element keeps its attributes unchanged.
Constraints
Hints
Write a program that renders JSX elements. The input will contain a string representing the JSX element. The output should be the rendered HTML string. For example, if the input is <div>Hello World</div>, the output should be <div>Hello World</div>.
Example 1
Input: <div>Hello World</div>
Output: <div>Hello World</div>
A simple element with text content renders exactly as written.
Example 2
Input: <p>This is a paragraph</p>
Output: <p>This is a paragraph</p>
The tag and its text are preserved in the output.
Example 3
Input: <img src="image.jpg" />
Output: <img src="image.jpg" />
A self-closing element keeps its attributes unchanged.
Constraints
Hints