2
I have a problem to concatenate variables that I have already created (I know .concat()
) and all that.
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 I wasn’t showing here so I took.
var dadosexemplo = input1 + input_2;
or .concat
didn’t work
result : [Object Htmlinputelement][Object Htmlinputelement]
How could I create variables that way:
var input1 = "input type='text' value='1'"
I want to change everything that this way to the one quoted above. But always returns me an Object ,e JSON.string... does not solve.
I want to create variables in the first way, concatenate them to create a block literally and then play on the page . php.
In short, I have the ugliest way. I have all html inside a " " and want to change to better preview and maintenance in the future.
Thanks bro, it helped a lot for me to have the idea.
– Rodrigo Luan