2014-04-17 43 views
0

在visualforce页面中,如果我有一个完全使用jQuery动态创建的DOM,我能动态地追加下面的代码吗?可以使用jQuery将顶点元素附加到html吗?

 <div id="file"> 
      <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" title="Upload Attachment" styleclass="fileType"/> 
     </div><br /> 

我可以使用jQuery将顶点元素附加到html吗?

回答

0

您可以使用.append()

$('#file').append('<apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" title="Upload Attachment" styleclass="fileType"/>'); 

Working Demo

+0

我敢肯定,这种做法是行不通的。也许使用常规的html元素,但不能使用顶点元素。 – Daft

+1

至少尝试一下... –

+0

对不起,我做了,它不工作。我真的希望它会,但没有喜悦。 – Daft

相关问题