-jQuery( function ( $ ) {
- var ak_js = $( '#ak_js' );
+var ak_js = document.getElementById( "ak_js" );
- // If the form field already exists just use that
- if ( ak_js.length == 0 ) {
- ak_js = $( '<input type="hidden" id="ak_js" name="ak_js" />' );
- }
- else {
- ak_js.remove();
- }
+if ( ! ak_js ) {
+ ak_js = document.createElement( 'input' );
+ ak_js.setAttribute( 'id', 'ak_js' );
+ ak_js.setAttribute( 'name', 'ak_js' );
+ ak_js.setAttribute( 'type', 'hidden' );
+}
+else {
+ ak_js.parentNode.removeChild( ak_js );
+}
+
+ak_js.setAttribute( 'value', ( new Date() ).getTime() );
- ak_js.val( ( new Date() ).getTime() );
+var commentForm = document.getElementById( 'commentform' );
- // single page, front-end comment form
- // inline comment reply, wp-admin
- $( '#commentform, #replyrow td:first' ).append( ak_js );
-} );
+if ( commentForm ) {
+ commentForm.appendChild( ak_js );
+}
+else {
+ var replyRowContainer = document.getElementById( 'replyrow' );
+
+ if ( replyRowContainer ) {
+ var children = replyRowContainer.getElementsByTagName( 'td' );
+
+ if ( children.length > 0 ) {
+ children[0].appendChild( ak_js );
+ }
+ }
+}
\ No newline at end of file