I have a js file(abc.js) and having a function increment().Which stores count of places as var noOfPlaces.
In the xhtml file.Have a component which is having onclick function.
I want to have if else condition inside onclick based on noOfPlaces.
abc.js
function increment(){
var noOfPlaces=(some methods);
cde.xhtml
<a4j:commandLink id="Import" type="submit"
rendered="#{()}"
onclick="focusOn('Import');if else condition
How can we use jaavascrpt variable value in xhtml page and write if else condition in onlick> I know how to use javamethods in xhtml (classname.methodname).How can we do for js file Thanks in advance