function takePhoto() {
  imageCapture
    .takePhoto()
    .then(function(blob) {
      document.getElementById('background_img_1').style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';
      document.getElementById('background_img_2').style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';
      change_state('question');
    })
    .catch(function(error) {
      console.log('takePhoto() error: ', error);
    });
}
// display this with an img element.

display this with an img element.
display this with an img element .
function takePhoto() {
  imageCapture
    .takePhoto()
    .then(function(blob) {
      document.getElementById('background_img_1').style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';
      document.getElementById('background_img_2').style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';
      change_state('question');
    })
    .catch(function(error) {
      console.log('takePhoto() error: ', error);
    });
}
function takePhoto ( ) { imageCapture . takePhoto ( ) . then ( function ( blob ) { document . getElementById ( 'background_img_1' ) . style . backgroundImage = 'url(' + URL . createObjectURL ( blob ) + ')' ; document . getElementById ( 'background_img_2' ) . style . backgroundImage = 'url(' + URL . createObjectURL ( blob ) + ')' ; change_state ( 'question' ) ; } ) . catch ( function ( error ) { console . log ( 'takePhoto() error: ' , error ) ; } ) ; }
display this with an img element.
display this with an img element .