-4
Hello. I have an HTML code that receives a read information from a QR Code, which contains information such as Client, Danfe, Code and Quantity and displays it within a textarea. This reading is done through an application separately from the code. Follow the HTML code:
<div>
<textarea type="text" id="dadosLidos" style="height: 250px; width: 700px;"></textarea>
</div>
The contents of this textarea are saved in a var in the Javascript file and printed in the console shortly after.
$scope.saveInfo = function() {
var dados = document.getElementById("dadosLidos").value;
console.log(dados);
};
An example of information that the textarea receives is:
CLIENTE: FULANO DE TAL
DANFE: 123456
CÓDIGO: 1234
QNT.: 2
What I need is to read only the content of the third line, ie, CODE: 1234. I’ll run a check against the code contained in each QR Code. How can I do to read or save in a variable only the contents of the third line, or the line CODE ?