Referring to the same code mentioned in my previous post:
<span class="test">
<cfclient>
<cfset variable1 = 10>
<cffunction name="test1">
<cfoutput>#variable1#</cfoutput>
<cfset variable1 = 20>
<cfoutput>#variable1#</cfoutput>
</cffunction>
<cfset test1()>
</cfclient>
</span>
The code that gets generated and executed will insert a DOM node into the page:
<span class="test">
<script type="text/javascript" src="/CFIDE/cfclient/cfclient_main.js"></script>
<script type="text/javascript" src="/CFIDE/cfclient/cffunctions.js"></script>
<meta name="viewport" content="width=device-width">
<script type="text/javascript">globalDivStruct=null;var _$test_func=function(){var self=this;var variables={};self.test1=function(){var localdivstruct=globalDivStruct;var __output_var="";localdivstruct.outputvar+=variable1;variable1=20;loca ldivstruct.outputvar+=variable1;return""};self.__init=function(){var localdivstruct=globalDivStruct;var __output_var="";var tmpVarArray={};variable1=10;test1();return""}};
function __startPage__$test(){document.write("\x3cdiv id\x3d'__cfclient_0'\x3e\x3c/div\x3e");window.ispgbuild=false;var clientDivStruct={divId:"__cfclient_0",outputvar:""};globalDivStruct=c lientDivStruct;try{_$test=new _$test_func;_$test.__init()}catch(__eArg){if(__eArg!=="$$$cfclient_ab ort$$$")throw __eArg;}__$cf.__flush(clientDivStruct)}__startPage__$test();function test1(){return _$test.test1()};
</script><div id="__cfclient_0">1020</div>
</span>
Notice that it creates a div element and with id="___cfclient_0", can I specify the tag name that has to be generated? For example, if I want a span element or a list element then I should be able specify that. Also, one should be able to add classes to it, specify attributes (data-).