For this exact use case I defined the following many years ago in my bash profile:
# create a new directory and enter it
function mkd() {
mkdir -p "$@" && cd "$_";
}
And use it like: mkd foo