Javascript: How to give String to onclick function : I want to give a String Parameter to a function

    function test(p)
    {
    }
    
    ...innerHTML = '<div onclick="test(p)"><div>';

That does not work how to do it?
    