I want to have a line of code similar to below:
var name = $(\'#input-name\').attr(\"value\");
However, the id \'input-name\' is not guaran
if ($('#input-name').length) { // do something }