Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict"
- document.querySelector("#alakit").addEventListener("click", (evt) => {
- evt.preventDefault()
- mezo.value = alakitas(mezo.value)
- })
- const mezo = document.getElementById("mezo")
- function alakitas(mezoadas) {
- const magyar = 'íéáűőúöüó'
- const angol = 'ieauououo'
- const magyarNagy = 'ÍÉÁŰŐÚÖÜÓ'
- const angolNagy = 'IEAUOUOUO'
- let proba = []
- const test = mezo.value
- for (let i = 0; i < test.length; i++) {
- proba.push(test[i])
- for (let j = 0; j < magyar.length; j++) {
- if (proba[i] == magyar[j]) {
- proba[i] = angol[j]
- }
- if (proba[i] == magyarNagy[j]) {
- proba[i] = angolNagy[j]
- }
- }
- }
- let fuzes = ""
- for (let fuz of proba) {
- fuzes += fuz
- }
- return fuzes
- }
Add Comment
Please, Sign In to add comment