I have a problem concatenating variables I've already created (I know .concat()
) and everything.
Problem:
var input1 = $('input').attr({
type: 'hidden',
value: 1
});
var input1_2 = $('input').attr({
type : 'text',
size : '14',
name : 'nomeTorre',
id : 'nomeTorre',
class: 'form-control'
});
I know you use < > but it was not showing here so I took it.
var dadosexemplo = input1 + input_2;
or .concat
did not work
result: [object HTMLInputElement] [object HTMLInputElement]
How could I create the variables this way, without doing this:
var input1 = "input type='text' value='1'"
I want to change everything that is this way to that quoted up there. But it always returns me an object, and JSON.string ... does not resolve.
I want to create variables of the first form, concatenate them to create a 'block' literally and then play on the .php page.
In short, I have the ugliest way. The whole html inside a "" and want to change to make it better to view and maintain in the future.