I am providing my users to create their own widgets on their profile pages.Widgets are created by HTML codes by user input.
But Sometimes, if user enter an invalid html code, widget field is corrupting. To avoid this situation, I must be sure the html code that user entered is valid.
My question is how to check a html code validation via PHP or Javascript.
Thanks in advance.