prettyphoto wont load when writing href using document.write
i have some codes like this

    <span id="$RsC" class="menu" title="Action menu" onclick="menu(\''.$RsC.'\')">click</span>
    
    function menu(id){ 
    var d = document.getElementById(id); 
    d.innerHTML ='<a href="somthing;iframe=true&amp;width=400&amp;height=170"  rel="prettyPhoto[iframe]" >Doesnt work</a>';
    }
    
    <script type="text/javascript" charset="utf-8">
    jQuery.noConflict();
    jQuery(document).ready(function($) {
    $(".pp_pic_holder").remove();
     $(".pp_overlay").remove();
     $(".ppt").remove();
    $(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'h0mayun'});
    });
    </script>

the problem is that after clicking on *"click"* and writing html link prettyPhoto plugin doesn't load

any help will be appreciated
prettyphoto wont load when writing href using document.write
===

i have some codes like this

    <span id="$RsC" class="menu" title="Action menu" onclick="menu(\''.$RsC.'\')">click</span>
    
    function menu(id){ 
    var d = document.getElementById(id); 
    d.innerHTML ='<a href="somthing;iframe=true&amp;width=400&amp;height=170"  rel="prettyPhoto[iframe]" >Doesnt work</a>';
    }
    
    <script type="text/javascript" charset="utf-8">
    jQuery.noConflict();
    jQuery(document).ready(function($) {
    $(".pp_pic_holder").remove();
     $(".pp_overlay").remove();
     $(".ppt").remove();
    $(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'h0mayun'});
    });
    </script>

the problem is that after clicking on *"click"* and writing html link prettyPhoto plugin doesn't load

any help will be appreciated