I am trying to create account on ethereum private network using web3js from front end. I have written the below lines in my js file. The createAccount() gets called from an HTML page
web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545"));
function createAccount(){
console.log("web3 version"+web3.version.api);
web3.eth.accounts.create();
}
I get the below in the console web3 version0.20.1
Uncaught TypeError: web3.eth.accounts.create is not a function
Is it possible to create account on the node from front end html page using web3js? If not then what are the steps for doing the same from web3j.