IFRAM XPATH
Publicado por Sebas05Sevi (1 intervención) el 02/10/2024 23:06:02
Nos ha dado un html que no se puede modificar que es este:
<!DOCTYPE html>
<html lang="utf-8">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ejercicio5</title>
</head>
<body>
<button id="mainButton">Botón Principal</button>
<iframe id="myIframe" width="200" height="200" frameborder="0" src="data:text/html;charset=utf-8,<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Contenido Iframe</title>
</head>
<body>
<button id='iframeButton'>Botón Iframe</button>
</body>
</html>">
</iframe>
<div id="xpathDisplay" style="margin-top: 20px; font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 10px;">
<strong>XPath:</strong> <span id="xpathValue"></span>
</div>
<script src="Ejercicio5.js"></script>
</body>
</html>
Nos ha dicho que tenemos que hacer que al clicar cualquier parte del documento nos de su xpath , todos los lugares del documento me salen su xpath meno el boton de Iframe que no sale su xpath. Todo esto se hace en un archivo .js
<!DOCTYPE html>
<html lang="utf-8">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ejercicio5</title>
</head>
<body>
<button id="mainButton">Botón Principal</button>
<iframe id="myIframe" width="200" height="200" frameborder="0" src="data:text/html;charset=utf-8,<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Contenido Iframe</title>
</head>
<body>
<button id='iframeButton'>Botón Iframe</button>
</body>
</html>">
</iframe>
<div id="xpathDisplay" style="margin-top: 20px; font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 10px;">
<strong>XPath:</strong> <span id="xpathValue"></span>
</div>
<script src="Ejercicio5.js"></script>
</body>
</html>
Nos ha dicho que tenemos que hacer que al clicar cualquier parte del documento nos de su xpath , todos los lugares del documento me salen su xpath meno el boton de Iframe que no sale su xpath. Todo esto se hace en un archivo .js
Valora esta pregunta


0