How can I access VF variable(value="{!articleAttach.downloadscount}") in javascript and increment the variable based on href click and then display the incremented variable in vf page ?
<apex:component>
<apex:attribute name="articleAttach" description="Referencing an article record" type="HiveArticleAttachment" required="true" />
<apex:attribute name="panelID" description="Referencing panel section" type="String" required="true" />
<apex:attribute name="networkURL" description="Referencing network URL" type="String" required="true" />
<style>
sub {
_vertical-align: 4px;
vertical-align: -8px;
font-size: larger;
padding: 1px 0px 0px 0px;
font-size: 1em;
}
</style>
<!-- Start Per Record -->
<span class="tab-pane" id="text1">
<div class="row" id="text2">
<div class="col-sm-6">
<div class="icon {!lower(articleAttach.IconTag)}"></div>
<img src="{!articleAttach.ArticleInfo.Image_URL__c}" />
</div>
<div class="col-sm-6" id="text3">
<div class="row" id="text4">
<div class="col-sm-12" id="text5">
<span>
<a href="{!networkURL}/hive/apex/HiveArticleContentDetail?Id={!articleAttach.ArticleInfo.ID}&frompage=hivehome" title="{!articleAttach.ArticleInfo.Name}">
<span><h4>{!articleAttach.ArticleInfo.Name}</h4></span>
</a>
</span>
<div>
<apex:outputPanel rendered="{!If(len(articleAttach.ArticleInfo.Menu_Tag__c)>1,true,false)}">
<span class="newscred">{!articleAttach.ArticleInfo.Menu_Tag__c}</span>
<span class="splitter"> | </span>
</apex:outputPanel>
<span class="author">{!articleAttach.ArticleInfo.Author__c}</span>
<span class="splitter"> | </span>
<span class="date">
<apex:outputText value="{0,date,MMM dd yyyy}">
<apex:param value="{!articleAttach.ArticleInfo.Submitted_Date__c}" />
</apex:outputText>
</span>
</div>
<div class="excerpt">
<br />
<apex:outputPanel rendered="{!If(len(articleAttach.ArticleInfo.Abstract__c)>350,true,false)}">
<apex:outputText value="{!left(articleAttach.ArticleInfo.Abstract__c,350)}" escape="false"></apex:outputText>
<a href="{!networkURL}/hive/apex/HiveArticleContentDetail?Id={!articleAttach.ArticleInfo.ID}" title="Click here to read more">
.. read more
</a>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(len(articleAttach.ArticleInfo.Abstract__c)<=350,true,false)}">
<apex:outputText value="{!articleAttach.ArticleInfo.Abstract__c}" escape="false"></apex:outputText>
</apex:outputPanel>
</div>
<div class="row" id="text6">
<div class="col-md-12" id="text7">
<apex:outputPanel rendered="{!If(articleAttach.FollowStatus=='Followed',true,false)}">
<span id="{!panelID}_spanunfollow_{!articleAttach.ArticleInfo.ID}" style="display:inline">
<a href="javascript:unfollowArticle('{!articleAttach.ArticleInfo.ID}'); " title="Unfollow this article" >
<img src="{!networkURL}/hive/s/Follow.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.followcount}"> </apex:outputText> </sub>
</span>
<span id="{!panelID}_spanfollow_{!articleAttach.ArticleInfo.ID}" style="display:none">
<a href="javascript:followArticle('{!articleAttach.ArticleInfo.ID}'); " title="Follow this article" >
<img src="{!networkURL}/hive/s/UnFollow.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.followcount-1}"> </apex:outputText></sub>
</span>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.FollowStatus!='Followed',true,false)}">
<span id="{!panelID}_spanunfollow_{!articleAttach.ArticleInfo.ID}" style="display:none">
<a href="javascript:unfollowArticle('{!articleAttach.ArticleInfo.ID}'); " title="Unfollow this article" >
<img src="{!networkURL}/hive/s/Follow.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.followcount+1}"> </apex:outputText> </sub>
</span>
<span id="{!panelID}_spanfollow_{!articleAttach.ArticleInfo.ID}" style="display:inline">
<a href="javascript:followArticle('{!articleAttach.ArticleInfo.ID}'); " title="Follow this article" >
<img src="{!networkURL}/hive/s/UnFollow.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.followcount}"> </apex:outputText></sub>
</span>
</apex:outputPanel>
<span id="{!panelID}_spanshare_{!articleAttach.ArticleInfo.ID}" style="display:none">
<a href="javascript:shareArticle('{!articleAttach.ArticleInfo.ID}');" title="Share this article" >
<img src="{!networkURL}/hive/s/Share.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.sharecount+1}"> </apex:outputText></sub>
</span>
<span id="{!panelID}_spanshare1_{!articleAttach.ArticleInfo.ID}" style="display:inline">
<a href="javascript:shareArticle('{!articleAttach.ArticleInfo.ID}');" title="Share this article">
<img src="{!networkURL}/hive/s/Share.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.sharecount}"> </apex:outputText></sub>
</span>
<!-- <a href="{!networkURL}/hive/apex/HiveArticleContentDetail?Id={!articleAttach.ArticleInfo.ID}&frompage=hivehome#articleComment" title="Post a comment on this article">
<img src="{!networkURL}/hive/s/Comment.png" style="width:16px; height:16px;" />
</a>-->
<apex:outputPanel rendered="{!If(articleAttach.Commentstatus!='Commented',true,false)}">
<a href="{!networkURL}/hive/apex/HiveArticleContentDetail?Id={!articleAttach.ArticleInfo.ID}&frompage=hivehome#articleComment" title="Be first to Post comment on this article">
<img src="{!networkURL}/hive/s/Comment_Gray.png" style="width:16px; height:16px;" /> </a>
<sub><apex:outputText value="{!articleAttach.commentcount}"> </apex:outputText> </sub>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.Commentstatus=='Commented',true,false)}">
<a href="{!networkURL}/hive/apex/HiveArticleContentDetail?Id={!articleAttach.ArticleInfo.ID}&frompage=hivehome#articleComment" title="Post a comment on this article">
<img src="{!networkURL}/hive/s/Comment.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.commentcount}"> </apex:outputText></sub>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.LikeStatus=='Liked',true,false)}">
<span id="{!panelID}_spanliked_{!articleAttach.ArticleInfo.ID}" style="display:inline">
<a href="javascript:unlikeArticle('{!articleAttach.ArticleInfo.ID}'); " title="Unlike this article" >
<img src="{!networkURL}/hive/s/Like.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.likescount}"> </apex:outputText> </sub>
</span>
<span id="{!panelID}_spanlike_{!articleAttach.ArticleInfo.ID}" style="display:none">
<a href="javascript:likeArticle('{!articleAttach.ArticleInfo.ID}'); " title="Like this article" >
<img src="{!networkURL}/hive/s/UnLike.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.likescount-1}"> </apex:outputText></sub>
</span>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.LikeStatus!='Liked',true,false)}">
<span id="{!panelID}_spanliked_{!articleAttach.ArticleInfo.ID}" style="display:none">
<a href="javascript:unlikeArticle('{!articleAttach.ArticleInfo.ID}'); " title="Unlike this article" >
<img src="{!networkURL}/hive/s/Like.png" style="width:16px; height:16px;" />
</a>
<sub> <apex:outputText value="{!articleAttach.likescount+1}"> </apex:outputText></sub>
</span>
<span id="{!panelID}_spanlike_{!articleAttach.ArticleInfo.ID}" style="display:inline">
<a href="javascript:likeArticle('{!articleAttach.ArticleInfo.ID}'); " title="Like this article" >
<img src="{!networkURL}/hive/s/UnLike.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.likescount}"> </apex:outputText></sub>
</span>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.AttachmentInfo.Id='',true,false)}">
<a title="No Attachment">
<img src="{!networkURL}/hive/s/Download_Gray.png" style="width:16px; height:16px;" />
</a>
</apex:outputPanel>
<apex:outputPanel rendered="{!If(articleAttach.AttachmentInfo.Id!='',true,false)}" id="op1">
<a href="{!networkURL}/hive/servlet/servlet.FileDownload?file={!articleAttach.AttachmentInfo.Id}" target="_blank" title="Right click to save, Double click to open the attached file" download="articleAttach.AttachmentInfo.Name" onclick="Hivedownloadcounter('{!articleAttach.ArticleInfo.ID}')">
<img src="{!networkURL}/hive/s/Download.png" style="width:16px; height:16px;" />
</a>
<sub><apex:outputText value="{!articleAttach.downloadscount}" id="downloadpanel"> </apex:outputText></sub>
</apex:outputPanel>
</div>
</div>
</div>
</div>
</div>
</div>
</span>
<!-- End Per Record -->
<br />
</apex:component>