I am trying to dynamically create a key in a JavaScript object with a jQuery selector:
{
$("form").children("input[type=hidden]").attr("name"): $("form").children("input[type=hidden]").val()
}
This is breaking though. Is it possible to dynamically create a key this way?
input[type=hidden]selector; if you add another hidden input value, it might break your code. It would be better if you named it.